-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sign goreleaser release using cosign custom key-pair (#544)
* feat: sign goreleaser release using keyless cosign * revert go.mod * bump goreleaser version in ci * add cosign public key * use custom key pair to sign and verify releases --------- Co-authored-by: michaeljguarino <[email protected]>
- Loading branch information
1 parent
209c1e7
commit 972b460
Showing
5 changed files
with
69 additions
and
15 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
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 |
---|---|---|
|
@@ -55,7 +55,7 @@ jobs: | |
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser-pro | ||
version: "~> v1" | ||
version: '~> v2' | ||
args: release --clean --split --timeout 90m | ||
env: | ||
CGO_LDFLAGS: "${{ matrix.goos == 'darwin' && '-framework UniformTypeIdentifiers' || '' }}" | ||
|
@@ -73,6 +73,9 @@ jobs: | |
needs: prepare | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
permissions: | ||
contents: write # needed to write releases | ||
id-token: write # needed for keyless signing | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -106,16 +109,20 @@ jobs: | |
uses: WyriHaximus/github-action-get-previous-tag@v1 | ||
env: | ||
INPUT_PREFIX: v | ||
- name: Install Cosign | ||
uses: sigstore/[email protected] | ||
- name: GoReleaser (Release) | ||
uses: goreleaser/goreleaser-action@v6 | ||
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit | ||
with: | ||
distribution: goreleaser-pro | ||
version: "~> v1" | ||
version: '~> v2' | ||
args: continue --merge --timeout 90m | ||
env: | ||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} | ||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | ||
GITLAB_CLIENT_SECRET: ${{ secrets.GITLAB_CLIENT_SECRET }} | ||
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | ||
GORELEASER_CURRENT_TAG: ${{ github.ref_name }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1WWDBE9BWad6LQyWg19q4EECmuvT | ||
CXFKwKNMfBPTLZrDqvmoH0Uc8GRKdQOlLGGDDbISd/Lj8OP6ui1SgjMC6g== | ||
-----END PUBLIC KEY----- |