Skip to content

Commit

Permalink
ci: add npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Jan 26, 2024
1 parent 1de972e commit cad2365
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- 'v*'

permissions:
contents: write
id-token: write

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -15,13 +19,23 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: true

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
cache: pnpm

- run: pnpm run build
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
- run: npm run ci:publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"scripts": {
"build": "pnpm -r --filter=./packages/** run build",
"ci:publish": "pnpm -r publish --access public --no-git-checks",
"lint": "eslint .",
"release": "bumpp",
"test": "vitest",
Expand Down

0 comments on commit cad2365

Please sign in to comment.