From 936591e4187c75d918be3d58f5dd58768bb4952e Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:03:16 -0400 Subject: [PATCH 1/2] ci: release flow --- .github/workflows/release.yml | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e6f5ace --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,63 @@ +name: Release Wasm + +on: + push: + tags: + - v* + workflow_dispatch: + inputs: + tag: + description: Release tag (e.g., v1.2.3) + required: true + type: string + +permissions: + contents: write + +env: + CARGO_TERM_COLOR: always + RUST_VERSION: 1.81.0 + +jobs: + release: + name: Build and Release + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Rust (stable) + wasm target + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_VERSION }} + targets: wasm32-unknown-unknown + - name: Install protoc + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler + protoc --version + - name: Install wasm-opt + run: cargo install wasm-opt --locked + - name: WASM release build + run: RUSTFLAGS="-C link-arg=-s" cargo wasm --locked + - name: Optimize WASM artifacts + run: | + mkdir artifacts + for f in target/wasm32-unknown-unknown/release/*.wasm; do + wasm-opt -Os "$f" -o "artifacts/$(basename "$f")" + done + - name: Generate checksums + run: | + cd artifacts + sha256sum -- *.wasm | tee checksums.txt + - name: Create GitHub Release and upload assets + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + target_commitish: ${{ github.sha }} + generate_release_notes: true + files: + artifacts/*.wasm + artifacts/checksums.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b94ee51ca5e524ab5f61e108d28269405117e272 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:08:56 -0400 Subject: [PATCH 2/2] ci: fix --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6f5ace..12eec41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: tag_name: ${{ github.ref_name }} target_commitish: ${{ github.sha }} generate_release_notes: true - files: + files: | artifacts/*.wasm artifacts/checksums.txt env: