Update verifier-e2e.all.workflow_dispatch.main.all.slsa3.yml #13729
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
schedule: | |
- cron: "0 2 * * *" | |
workflow_dispatch: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" # # triggers only if push new tag version, like `v0.8.4` or else | |
permissions: read-all | |
concurrency: "e2e.generic.tag.main.annotated.slsa3" | |
env: | |
GH_TOKEN: ${{ secrets.E2E_GENERIC_TOKEN }} | |
ISSUE_REPOSITORY: slsa-framework/slsa-github-generator | |
DEFAULT_VERSION: v26.0.0 | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- id: create | |
run: ./.github/workflows/scripts/e2e-create-release.sh | |
shim: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
outputs: | |
continue: ${{ steps.verify.outputs.continue }} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- id: verify | |
run: ./.github/workflows/scripts/e2e-verify-release.sh | |
build: | |
runs-on: ubuntu-latest | |
needs: [shim] | |
if: needs.shim.outputs.continue == 'yes' && github.event_name == 'push' && github.ref_type == 'tag' | |
outputs: | |
digest: ${{ steps.hash.outputs.digest }} | |
steps: | |
- name: Build artifacts | |
run: | | |
# These are some amazing artifacts. | |
echo "build 1 artifact 1" > artifact1 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
path: artifact1 | |
name: artifact1 | |
if-no-files-found: error | |
retention-days: 5 | |
- name: Generate hashes | |
shell: bash | |
id: hash | |
run: | | |
# sha256sum generates sha256 hash for all artifacts. | |
# base64 -w0 encodes to base64 and outputs on a single line. | |
# sha256sum artifact1 ... | base64 -w0 | |
echo "digest=$(sha256sum artifact1 | base64 -w0)" >> "${GITHUB_OUTPUT}" | |
provenance: | |
needs: [shim, build] | |
if: needs.shim.outputs.continue == 'yes' && github.event_name == 'push' && github.ref_type == 'tag' | |
permissions: | |
id-token: write # For signing. | |
contents: write # For asset uploads. | |
actions: read # For the entrypoint. | |
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@main | |
with: | |
base64-subjects: "${{ needs.build.outputs.digest }}" | |
compile-generator: true | |
verify: | |
runs-on: ubuntu-latest | |
needs: [shim, build, provenance] | |
if: needs.shim.outputs.continue == 'yes' && github.event_name == 'push' && github.ref_type == 'tag' | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: artifact1 | |
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: ${{ needs.provenance.outputs.provenance-name }} | |
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version: "1.21" | |
- env: | |
BINARY: artifact1 | |
PROVENANCE: ${{ needs.provenance.outputs.provenance-name }} | |
run: ./.github/workflows/scripts/e2e.generic.default.verify.sh | |
if-succeeded: | |
runs-on: ubuntu-latest | |
needs: [shim, build, provenance, verify] | |
if: needs.shim.outputs.continue == 'yes' && github.event_name == 'push' && github.ref_type == 'tag' && needs.build.result == 'success' && needs.provenance.result == 'success' && needs.verify.result == 'success' | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: ./.github/workflows/scripts/e2e-report-success.sh | |
if-failed: | |
runs-on: ubuntu-latest | |
needs: [shim, build, provenance, verify] | |
if: always() && needs.shim.outputs.continue == 'yes' && github.event_name == 'push' && github.ref_type == 'tag' && (needs.build.result == 'failure' || needs.provenance.result == 'failure' || needs.verify.result == 'failure') | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: ./.github/workflows/scripts/e2e-report-failure.sh |