feat: update package name and improve build workflow for versioned releases
This commit is contained in:
25
.github/workflows/build.yml
vendored
25
.github/workflows/build.yml
vendored
@@ -3,6 +3,7 @@ name: Build WASM
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ['v*']
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
@@ -94,3 +95,27 @@ 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: Install dependencies
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
working-directory: js/
|
||||
run: npm ci
|
||||
|
||||
- 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 }}
|
||||
|
||||
Reference in New Issue
Block a user