-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea64639
commit 9274bec
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Dispatch NPM release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
type: choice | ||
description: "Package to release" | ||
required: true | ||
options: | ||
- "identity-kit" | ||
|
||
level: | ||
type: choice | ||
description: Select the release update level | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
- prepatch | ||
- preminor | ||
- premajor | ||
- prerelease | ||
preid: | ||
type: choice | ||
required: false | ||
description: Select pre-id (alpha | beta) | ||
default: "none" | ||
options: | ||
- alpha | ||
- beta | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: π§ Git | ||
run: | | ||
git config user.email "github@indentitylabs.ooo" | ||
git config user.name "Github InternetIdentityLabs" | ||
- name: π§ Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: π§ Yarn | ||
run: | | ||
yarn config set version-git-message "chore(${{ github.event.inputs.package }}): release v%s" | ||
yarn config set version-tag-prefix "@nfid/${{ github.event.inputs.package }}-v" | ||
- name: π€ Install | ||
run: yarn | ||
|
||
- name: π€ Increment package version | ||
working-directory: packages/${{ github.event.inputs.package }} | ||
run: | | ||
if [[ ${{ github.event.inputs.level }} == "pre"* ]]; then | ||
yarn version --${{ github.event.inputs.level }} --preid ${{ github.event.inputs.preid }} | ||
else | ||
yarn version --${{ github.event.inputs.level }} | ||
fi | ||
- name: π€ Build | ||
run: npx nx build ${{ github.event.inputs.package }} | ||
|
||
- name: π¦ Publish package on NPM | ||
working-directory: packages/${{ github.event.inputs.package }}/dist | ||
run: yarn publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.IL_GH_NPM_TOKEN }} | ||
|
||
- name: π Push tags | ||
run: | | ||
git push | ||
git push --tags |