From 9274bece410162647233142f753792e0d5ef3ac5 Mon Sep 17 00:00:00 2001 From: Philipp Litzenberger Date: Mon, 11 Dec 2023 11:50:18 +0100 Subject: [PATCH] feat([]): --- .github/workflows/npm-release.yml | 79 +++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/npm-release.yml diff --git a/.github/workflows/npm-release.yml b/.github/workflows/npm-release.yml new file mode 100644 index 00000000..d9b0c7e7 --- /dev/null +++ b/.github/workflows/npm-release.yml @@ -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