name: wai-quantum for JavaScript, release tarball # On a tag wai-quantum-cli-v (the command line's release), builds the npm # package @transaction-science/wai-quantum (wai/wai-quantum-js) and attaches its # tarball to the same forge release, with its SHA-256. ci/check.sh builds it, holds # the tarball to the package's allow-list, runs the smoke test on it unpacked and the # README's Node example on it installed, before it is attached. Nothing is published # to a package registry: the tarball is published from the release by hand. # # Uploads go to the forge directly over the private network (FORGE_API), never through # the public tunnel. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: push: tags: ['wai-quantum-cli-v*'] permissions: contents: write env: CARGO_TERM_COLOR: always FORGE_API: http://100.64.224.0:3400/api/v1 FORGE_REPO: Transaction-Science/open-standards jobs: version: name: the tag is the command line's version runs-on: linux outputs: version: ${{ steps.v.outputs.version }} steps: - uses: actions/checkout@v5 - id: v shell: bash run: | set -euo pipefail v="${GITHUB_REF_NAME#wai-quantum-cli-v}" crate="$(sed -n 's/^version = "\(.*\)"$/\1/p' wai/wai-quantum-cli/Cargo.toml | head -1)" [ "$v" = "$crate" ] || { echo "::error::the tag says $v, wai-quantum-cli/Cargo.toml says $crate"; exit 1; } echo "the npm package: $(python3 -I -c 'import json; print(json.load(open("wai/wai-quantum-js/package.json"))["version"])')" echo "version=$v" >> "$GITHUB_OUTPUT" tarball: name: the npm tarball ยท linux needs: version runs-on: linux timeout-minutes: 60 steps: - uses: actions/checkout@v5 - name: Install Rust 1.99.1 with the wasm32 target shell: bash run: | export PATH="$HOME/.cargo/bin:$PATH" command -v rustup >/dev/null 2>&1 || \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.99.1 rustup toolchain install 1.99.1 --profile minimal rustup default 1.99.1 rustup target add wasm32-unknown-unknown echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - name: wasm-bindgen CLI 0.2.127 shell: bash run: cargo install --locked wasm-bindgen-cli --version 0.2.127 - uses: actions/setup-node@v4 with: node-version: '22' - name: Build, check and hash shell: bash run: bash wai/wai-quantum-js/ci/check.sh "$RUNNER_TEMP/dist" - name: Attach to the release shell: bash env: FORGE_TOKEN: ${{ github.token }} run: bash wai/wai-quantum-cli/release/publish.sh "$GITHUB_REF_NAME" "wai-quantum ${{ needs.version.outputs.version }}" "$RUNNER_TEMP"/dist/*.tgz "$RUNNER_TEMP"/dist/*.tgz.sha256