Skip to content

Commit

Permalink
chore: release workflow setup (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhwhite authored Feb 7, 2023
2 parents e61344c + f6b1683 commit fc6380e
Show file tree
Hide file tree
Showing 10 changed files with 1,507 additions and 309 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ jobs:
key: ${{ runner.os }}-node-${{ env.node_version }}-${{ hashFiles('**/package-lock.json') }}
- name: Install
run: npm ci
env:
npm_config_loglevel: warn
if: steps.cache-node-modules.outputs.cache-hit != 'true'
- name: Set NX SHAs
uses: nrwl/nx-set-shas@v3
- name: Lint, Build, Test
run: |
npx nx workspace-lint
npx nx format:check
npx nx affected \
--base="${{ env.NX_BASE }}" \
--head="${{ env.NX_HEAD }}" \
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
branches:
- main

env:
node_version: 18
jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v2
id: release
with:
release-type: node
package-name: ng-keyboard-sort
path: libs/ng-keyboard-sort
token: ${{ secrets.GH_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
if: steps.release.outputs.releases_created
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
registry-url: 'https://registry.npmjs.org'
if: steps.release.outputs.releases_created
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ env.node_version }}-${{ hashFiles('**/package-lock.json') }}
if: steps.release.outputs.releases_created
- name: Install
run: npm ci
if: steps.release.outputs.releases_created && steps.cache-node-modules.outputs.cache-hit != 'true'
- name: Publish to NPM
if: steps.release.outputs.releases_created
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
echo '//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}' >> ~/.npmrc
cd dist/ng-keyboard-sort
npm publish --tag next --access public
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
/node_modules
npm-debug.log
yarn-error.log
/libs/*/package-lock.json
/libs/*/node_modules

# IDEs and editors
.idea/
Expand Down Expand Up @@ -40,3 +42,5 @@ testem.log
# System files
.DS_Store
Thumbs.db

.angular
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -ex

npx pretty-quick --staged
npx nx workspace-lint
npx nx format:check
npx nx affected --targets=lint,build,test --configuration=ci
npx playwright install --with-deps
npm run e2e -- --browser=all
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## 1.0.0-beta.0 (2023-01-19)

### Features

- Initial release.
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
26 changes: 3 additions & 23 deletions libs/ng-keyboard-sort/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
# NgKeyboardSort
# ng-keyboard-sort

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.0.
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

## Code scaffolding

Run `ng generate component component-name --project ng-keyboard-sort` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ng-keyboard-sort`.

> Note: Don't forget to add `--project ng-keyboard-sort` or else it will be added to the default project in your `angular.json` file.
## Build

Run `ng build ng-keyboard-sort` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build ng-keyboard-sort`, go to the dist folder `cd dist/ng-keyboard-sort` and run `npm publish`.

## Running unit tests

Run `ng test ng-keyboard-sort` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
Library to add keyboard commands for elements that also use CDK drag and drop sorting. This library intends to provide parity for picking up an element with the keyboard, moving it up and down the list, and dropping it in place.
3 changes: 2 additions & 1 deletion libs/ng-keyboard-sort/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
},
"dependencies": {
"tslib": "^2.3.0"
}
},
"sideEffects": false
}
Loading

0 comments on commit fc6380e

Please sign in to comment.