-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add GitHub Actions workflow for publishing to NPM and GitHub Rele…
…ases
- Loading branch information
1 parent
8331891
commit 41474c1
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish | ||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22.x" | ||
cache: "yarn" | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build | ||
run: npm run build | ||
- name: Publish to NPM | ||
run: | | ||
npm set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN | ||
npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | ||
- name: Publish to GitHub | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
make_latest: true | ||
generate_release_notes: true |