Skip to content

Commit 2b7f6c9

Browse files
committed
ci: merge WASM build and release into main CI workflow
This ensures that a GitHub Release is only created/updated after tests succeed, attaching the WASM build alongside other assets.
1 parent abdeb8e commit 2b7f6c9

2 files changed

Lines changed: 14 additions & 56 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ name: CI
33
on:
44
push:
55
branches: [ master, main ]
6-
tags: [ 'v*.*.*' ]
6+
tags: [ 'v*' ]
77
pull_request:
88
branches: [ master, main ]
99

10+
permissions:
11+
contents: write
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
@@ -35,8 +38,17 @@ jobs:
3538
run: make test
3639
- name: Build
3740
run: make build
41+
- name: Install binaryen
42+
run: sudo apt-get update && sudo apt-get install -y binaryen
3843
- name: Build WASM
39-
run: make build_wasm
44+
run: |
45+
make build_wasm
46+
for f in bin/*.wasm; do
47+
if [ -f "$f" ]; then
48+
wasm-opt -O3 "$f" -o "$f" || true
49+
cp "$f" dist/
50+
fi
51+
done
4052
- name: Upload Build Artifacts
4153
uses: actions/upload-artifact@v6
4254
with:

‎.github/workflows/release-wasm.yml‎

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)