Skip to content

Commit

Permalink
feat([]):
Browse files Browse the repository at this point in the history
  • Loading branch information
plitzenberger committed Dec 11, 2023
1 parent ea64639 commit 9274bec
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/npm-release.yml
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

0 comments on commit 9274bec

Please sign in to comment.