-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: keyless realeases with goreleaser and cosign
This commit enables keyless signatures via the Github Actions workload identity. The pipeline will run on a new tag and will generate a compiled cli and server version of TUF and a signed source tarball. The keys are ephemeral and valid for 30min and strictly coupled to the workload identity of the Github Actions workflow. Transparency logs will be automatically uploaded to the public rekor instance
- Loading branch information
Showing
4 changed files
with
30 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -33,7 +33,16 @@ jobs: | |
run: | | ||
GO111MODULE=off go get github.com/mattn/goveralls | ||
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github | ||
- name: Vet | ||
run: go vet ./... | ||
- name: Install staticcheck | ||
run: "go install honnef.co/go/tools/cmd/[email protected]" | ||
- name: Run staticcheck | ||
run: staticcheck ./... | ||
release-server: | ||
permissions: | ||
id-token: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
|
@@ -46,25 +55,24 @@ jobs: | |
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: write cosign.key to environment | ||
run: 'echo "$COSIGN_KEY" > .github/cosign.key' | ||
shell: bash | ||
env: | ||
COSIGN_KEY: ${{ secrets.COSIGN_KEY }} | ||
- name: install cosign | ||
uses: sigstore/cosign-installer@main | ||
with: | ||
cosign-release: 'v1.2.1' | ||
cosign-release: 'v1.4.1' | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: 'v0.180.2' | ||
version: 'v1.2.2' | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COSIGN_PWD: ${{ secrets.COSIGN_PWD }} | ||
COSIGN_EXPERIMENTAL: 1 | ||
release-cli: | ||
permissions: | ||
id-token: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
|
@@ -85,13 +93,13 @@ jobs: | |
- name: install cosign | ||
uses: sigstore/cosign-installer@main | ||
with: | ||
cosign-release: 'v1.2.1' | ||
cosign-release: 'v1.4.1' | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: 'v0.180.2' | ||
version: 'v1.1.0' | ||
args: release --config ./.goreleaser_client.yaml --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COSIGN_PWD: ${{ secrets.COSIGN_PWD }} | ||
COSIGN_EXPERIMENTAL: 1 |
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