forked from gluesql/gluesql
-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (41 loc) · 1.28 KB
/
Copy pathpublish-javascript.yml
File metadata and controls
44 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Publish JavaScript
on:
workflow_dispatch:
inputs:
# Latest commit to include with the release. If omitted, use the latest commit on the main branch.
sha:
description: Commit SHA
type: string
dry_run:
description: Dry run
type: boolean
default: true
env:
CARGO_TERM_COLOR: always
jobs:
publish_to_npm:
name: to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Set up wasm pack
uses: jetli/wasm-pack-action@v0.4.0
with:
version: 'v0.13.0'
- run: |
printf '\n[profile.release]\nopt-level = "s"\n' >> Cargo.toml
cd pkg/javascript
wasm-pack build --no-pack --target web --no-typescript --release --out-dir ./dist_web
wasm-pack build --no-pack --target nodejs --no-typescript --release --out-dir ./dist_nodejs -- --no-default-features --features nodejs
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
npm publish --dry-run
else
npm publish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM }}