Skip to content

Commit

Permalink
feat: add npm-publish ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
beqaabu committed Jan 16, 2025
1 parent 9c220e9 commit 25bce4e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and publish to npm

on:
push:
tags:
- 'v*'

env:
CARGO_TERM_COLOR: always

jobs:
build_and_publish:
runs-on: ubuntu-latest

steps:
- name: Check out code
- uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Install wasm-pack
run: |
cargo install wasm-pack
- name: Build wasm package
run: |
wasm-pack build --target nodejs --out-dir pkg
- name: Copy COPYRIGHT
run: |
cp COPYRIGHT pkg/
- name: Remove .gitignore
run: |
rm pkg/.gitignore
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
scope: '@gluwa'

- name: Publish to npm
run: |
cd pkg
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 25bce4e

Please sign in to comment.