CI pipeline for verifiable builds (#496)

This commit is contained in:
Christian Kamm 2023-03-07 17:28:26 +01:00 committed by GitHub
parent cfdfd2f8a0
commit 305e646262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,46 @@
name: Verifiable Build
on:
push:
tags:
- "program-v*"
env:
APP_NAME: mango_v4
jobs:
build:
name: Build Verifiable Artifact
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Verifiable Build
run: |
cargo run -p anchor-cli -- build --verifiable --solana-version 1.14.13 -- --features enable-gpl
- name: Generate Checksum
run: |
echo "CHECKSUM=$(sha256sum ./target/verifiable/${{ env.APP_NAME }}.so | head -c 64)" >> $GITHUB_ENV
- name: Generate SBOM
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
format: 'cyclonedx'
output: '${{ env.APP_NAME }}-${{ github.ref_name }}-sbom.json'
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: |
sha256 checksum: ${{ env.CHECKSUM }}
github commit: ${{ github.sha }}
files: |
./target/verifiable/${{ env.APP_NAME }}.so
./${{ env.APP_NAME }}-${{ github.ref_name }}-sbom.json