feat: update package name and improve build workflow for versioned releases

This commit is contained in:
2026-03-01 16:06:12 +08:00
parent eaa30795db
commit 33db721df7
2 changed files with 31 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ name: Build WASM
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
@@ -94,3 +95,22 @@ jobs:
dist/anisette_rs.node.js
dist/anisette_rs.node.wasm
generate_release_notes: true
- name: Setup Node.js
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
- name: Build TypeScript
if: startsWith(github.ref, 'refs/tags/v')
working-directory: js/
run: npm run build
- name: Publish to GitHub Packages
if: startsWith(github.ref, 'refs/tags/v')
working-directory: js/
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}