From 08b129ad5c84df9b24f1303f92167cd3859efe98 Mon Sep 17 00:00:00 2001 From: "denis.d" Date: Thu, 24 Nov 2022 10:59:03 +0100 Subject: [PATCH] fix: update release script --- .github/workflows/github-release-workflow.yml | 33 +++++++++++++++++++ .../workflows/public-npm-release-workflow.yml | 12 ++----- 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/github-release-workflow.yml diff --git a/.github/workflows/github-release-workflow.yml b/.github/workflows/github-release-workflow.yml new file mode 100644 index 00000000..9afb047b --- /dev/null +++ b/.github/workflows/github-release-workflow.yml @@ -0,0 +1,33 @@ +name: Public Release to npmjs.com + +on: + push: + branches: + - main + +jobs: + if_merged: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" + scope: "@affinidi" + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build:binary + + - name: Run release + run: + npm run semantic-release + env: + NODE_AUTH_TOKEN: ${{secrets.PUBLIC_NPM_NODE_AUTH_TOKEN}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/public-npm-release-workflow.yml b/.github/workflows/public-npm-release-workflow.yml index b5e82f81..f363dae3 100644 --- a/.github/workflows/public-npm-release-workflow.yml +++ b/.github/workflows/public-npm-release-workflow.yml @@ -1,9 +1,8 @@ name: Public Release to npmjs.com on: - push: - branches: - - main + release: + types: [published] jobs: if_merged: @@ -25,13 +24,6 @@ jobs: - name: Build run: npm run build:binary - - name: Run release - run: - npm run semantic-release - env: - NODE_AUTH_TOKEN: ${{secrets.PUBLIC_NPM_NODE_AUTH_TOKEN}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Publish to npmjs.org run: npm publish --access public --dry-run env: