-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (60 loc) · 2.04 KB
/
publish.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Publish
on:
push:
tags:
- "v*"
jobs:
publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install llvm and clang
run: sudo apt-get install llvm clang
- name: Install CMake
run: sudo apt-get install cmake
- name: Install Ninja
run: sudo apt-get install ninja-build
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.51
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
registry-url: "https://registry.npmjs.org"
- name: Install wasm-opt
run: |
npm install -g binaryen
- name: Build
run: ./scripts/build.sh
shell: bash
env:
WASM_OPT: 1
- name: Publish to npm
run: cd pkg && npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
registry-url: "https://npm.pkg.github.com"
- name: Publish to GitHub Packages
run: cd pkg && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to jsr.io
run: cd pkg && npx jsr publish
- name: Pack
run: cd pkg && npm pack
- name: Publish to Github Releases
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
with:
files: |
pkg/*.tgz
pkg/*.wasm