test 5 : pass GOOS and GOARCH from matrix #22
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
name: SLSA releaser | |
on: [push] | |
# on: | |
# workflow_dispatch: | |
# push: | |
# tags: | |
# - "*" | |
# pull_request: | |
# branches: [ "main" ] | |
# permissions: read-all | |
env: | |
GO_VERSION: 1.19 | |
jobs: | |
# Generate ldflags dynamically. | |
args: | |
runs-on: ubuntu-latest | |
outputs: | |
ldflags: ${{ steps.ldflags.outputs.value }} | |
go-binary-name: ${{ steps.build.outputs.go-binary-name }} | |
steps: | |
- id: checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
- id: ldflags | |
run: | | |
echo "value=$(./scripts/version-ldflags)" >> "$GITHUB_OUTPUT" | |
# Trusted builder. | |
build: | |
permissions: | |
id-token: write | |
contents: write | |
actions: read | |
needs: args | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] #7f4fdb871876c23e455853d694197440c5a91506 | |
with: | |
go-version: 1.19 | |
# goos: ${{ matrix.os }} | |
# goarch: ${{ matrix.arch }} | |
evaluated-envs: "VERSION_LDFLAGS:${{needs.args.outputs.ldflags}},GOOS:${{ matrix.os }},GOARCH:${{ matrix.arch }}" | |
strategy: | |
matrix: | |
os: | |
- linux | |
- windows | |
- darwin | |
arch: | |
- amd64 | |
- arm64 | |
exclude: | |
- arch: arm64 | |
os: windows | |
verification: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: read-all | |
steps: | |
- name: Install the verifier | |
uses: slsa-framework/slsa-verifier/actions/[email protected] | |
- name: Download the artifact | |
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 | |
with: | |
name: "${{ needs.build.outputs.go-binary-name }}.intoto.jsonl" | |
- name: Download the artifact | |
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 | |
with: | |
name: ${{ needs.build.outputs.go-binary-name }} | |
- name: Verify assets | |
env: | |
ARTIFACT: ${{ needs.build.outputs.go-binary-name }} | |
ATT_FILE_NAME: "${{ needs.build.outputs.go-binary-name }}.intoto.jsonl" | |
run: | | |
set -euo pipefail | |
echo "Verifying $ARTIFACT using $ATT_FILE_NAME" | |
slsa-verifier verify-artifact --provenance-path "$ATT_FILE_NAME" \ | |
--source-uri "github.com/$GITHUB_REPOSITORY" \ | |
"$ARTIFACT" |