Skip to content

Commit

Permalink
feat: job for npm base package release
Browse files Browse the repository at this point in the history
  • Loading branch information
thetnaingtn committed Dec 24, 2023
1 parent e0d8b93 commit f4283a2
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- "v*.*.*"
workflow_dispatch:

jobs:
goreleaser:
Expand All @@ -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 }}

Expand Down Expand Up @@ -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}}

0 comments on commit f4283a2

Please sign in to comment.