-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use generic generator for SLSA (#2146)
* update * update * update * update * update * update * update * update * update * update
- Loading branch information
1 parent
6001571
commit 887facf
Showing
6 changed files
with
54 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ permissions: | |
|
||
jobs: | ||
goreleaser: | ||
outputs: | ||
hashes: ${{ steps.hash.outputs.hashes }} | ||
permissions: | ||
contents: write # for goreleaser/goreleaser-action to create a GitHub release | ||
runs-on: ubuntu-latest | ||
|
@@ -52,6 +54,7 @@ jobs: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
- name: Run GoReleaser | ||
id: run-goreleaser | ||
uses: goreleaser/goreleaser-action@b953231f81b8dfd023c58e0854a721e35037f28b # v2.5.0 | ||
with: | ||
version: latest | ||
|
@@ -60,3 +63,23 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
VERSION_LDFLAGS: ${{ steps.ldflags.outputs.version_flags }} | ||
- name: Generate subject | ||
id: hash | ||
env: | ||
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}" | ||
run: | | ||
set -euo pipefail | ||
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path') | ||
echo "::set-output name=hashes::$(cat $checksum_file | base64 -w0)" | ||
provenance: | ||
needs: [goreleaser] | ||
permissions: | ||
actions: read # To read the workflow path. | ||
id-token: write # To sign the provenance. | ||
contents: write # To add assets to a release. | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}" | ||
upload-assets: true # upload to a new release |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name: SLSA releaser | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "*" | ||
# push: | ||
# tags: | ||
# - "*" | ||
|
||
permissions: read-all | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ builds: | |
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- 386 | ||
- arm | ||
|
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
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
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