From e508d67d3898117ce31cf92aa5ebe9f7c6fe9dd6 Mon Sep 17 00:00:00 2001 From: Trevor Lovell Date: Fri, 22 Nov 2024 11:45:32 -0700 Subject: [PATCH] ci: build wasm and javascript index as artifacts of release As a preliminary step to uploading to NPM, we'd like to package the wasm and test its build process and utility in github releases alone. At this point, the SDK should be usable from chainlink, just with slightly less convenience. --- .github/workflows/release.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d251991..930659b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,10 +40,28 @@ jobs: github_token: ${{ secrets.GH_TOKEN }} branch: ${{ github.ref }} + - name: Install stable toolchain + run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env + + - name: Install build dependencies + run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld protobuf-compiler + + - name: Install wasm-pack + run: cargo install wasm-pack + + - name: Build wasm binary + run: wasm-pack build --release --target deno --no-typescript crates/proof-of-sql-sdk-wasm + + - name: Build javascript index + run: | + chmod +x ./node/src/build_index.sh + ./node/src/build_index.sh crates/proof-of-sql-sdk-wasm/pkg + - name: Create Release uses: ncipollo/release-action@v1 with: tag: ${{ steps.conventional-changelog.outputs.tag }} body: ${{ steps.conventional-changelog.outputs.changelog }} token: ${{ secrets.GH_TOKEN }} + artifacts: "node/src/index.js,node/src/sxt_proof_of_sql_sdk_wasm_bg.wasm" makeLatest: true