add SLSA goreleaser config for darwin-arm64 (#125) #8
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 go releaser | |
on: | |
push: | |
tags: | |
# available only for tags like `v1.2.3` or `v1.2.3-rc1` | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-*" | |
permissions: read-all | |
jobs: | |
# Generate ldflags dynamically. | |
# Optional: only needed for ldflags. | |
args: | |
runs-on: ubuntu-latest | |
outputs: | |
commit-date: ${{ steps.ldflags.outputs.commit-date }} | |
commit: ${{ steps.ldflags.outputs.commit }} | |
version: ${{ steps.ldflags.outputs.version }} | |
tree-state: ${{ steps.ldflags.outputs.tree-state }} | |
version-package: github.com/sigstore/k8s-manifest-sigstore/pkg/util | |
steps: | |
- id: checkout | |
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2.3.4 | |
with: | |
fetch-depth: 0 | |
- id: ldflags | |
run: | | |
echo "::set-output name=commit-date::$(git log --date=iso8601-strict -1 --pretty=%ct)" | |
echo "::set-output name=commit::$GITHUB_SHA" | |
echo "::set-output name=version::$(git describe --tags --always --dirty | cut -c2-)" | |
echo "::set-output name=tree-state::$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" | |
# Trusted builder. | |
build-linux-amd64: | |
permissions: | |
id-token: write # To sign the provenance. | |
contents: write # To upload assets to release. | |
actions: read # To read the workflow path. | |
needs: args | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | |
with: | |
config-file: .slsa-goreleaser-linux-amd64.yml | |
go-version: 1.21 | |
evaluated-envs: "COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}, VERSION_PKG:${{needs.args.outputs.version-package}}" | |
build-darwin-amd64: | |
permissions: | |
id-token: write # To sign the provenance. | |
contents: write # To upload assets to release. | |
actions: read # To read the workflow path. | |
needs: args | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | |
with: | |
config-file: .slsa-goreleaser-darwin-amd64.yml | |
go-version: 1.21 | |
evaluated-envs: "COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}, VERSION_PKG:${{needs.args.outputs.version-package}}" | |
build-darwin-arm64: | |
permissions: | |
id-token: write # To sign the provenance. | |
contents: write # To upload assets to release. | |
actions: read # To read the workflow path. | |
needs: args | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | |
with: | |
config-file: .slsa-goreleaser-darwin-arm64.yml | |
go-version: 1.21 | |
evaluated-envs: "COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}, VERSION_PKG:${{needs.args.outputs.version-package}}" | |
build-windows-amd64: | |
permissions: | |
id-token: write # To sign the provenance. | |
contents: write # To upload assets to release. | |
actions: read # To read the workflow path. | |
needs: args | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | |
with: | |
config-file: .slsa-goreleaser-windows-amd64.yml | |
go-version: 1.21 | |
evaluated-envs: "COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}, VERSION_PKG:${{needs.args.outputs.version-package}}" | |