From f4283a20fbb76ee81dbd6e35dc1adba9a2a05253 Mon Sep 17 00:00:00 2001 From: thetnaingtn Date: Sun, 24 Dec 2023 10:11:35 +0700 Subject: [PATCH] feat: job for npm base package release --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e9a689..c784fcb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - "v*.*.*" + workflow_dispatch: jobs: goreleaser: @@ -26,8 +27,8 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: distribution: goreleaser - version: ${{ env.GITHUB_REF_NAME }} - args: release --rm-dist + version: latest + args: release --clean env: GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} @@ -99,3 +100,31 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NPM_API_KEY}} + publish-npm: + needs: publish-binaries + name: Publish base package to NPM + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set the release version + shell: bash + run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: "16" + registry-url: "https://registry.npmjs.org" + - name: Publish to NPM + shell: bash + run: | + cd npm/forky + yarn install + yarn build + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_API_KEY}} \ No newline at end of file