-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from thepwagner-org/github-attestations
attest-build-provenance
- Loading branch information
Showing
2 changed files
with
62 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Example repository: https://github.com/thepwagner/github-token-factory-oidc | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
docker: | ||
required: false | ||
type: boolean | ||
description: Whether to build and push a Docker image | ||
default: false | ||
go-version-file: | ||
required: false | ||
type: string | ||
description: Path to go.mod file | ||
default: "go.mod" | ||
secrets: | ||
ghcr-token: | ||
required: false | ||
description: Token to use for GitHub container registry | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to attach artifacts to releases | ||
id-token: write | ||
attestations: write | ||
steps: | ||
- name: "π Fetching code" | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
persist-credentials: false | ||
- name: "π Setup Go" | ||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | ||
with: | ||
go-version-file: ${{inputs.go-version-file}} | ||
- name: "π³ Logging in to Docker Registry" | ||
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | ||
if: ${{ inputs.docker }} | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.ghcr-token }} | ||
- name: "π¦ Release" | ||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | ||
with: | ||
version: v1.25.1 | ||
args: release --clean --parallelism=1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: "π Sign .deb" | ||
uses: actions/attest-build-provenance@897ed5eab6ed058a474202017ada7f40bfa52940 # v1.0.0 | ||
with: | ||
subject-path: "dist/*.deb" | ||
- name: "π Sign .tar.gz" | ||
uses: actions/attest-build-provenance@897ed5eab6ed058a474202017ada7f40bfa52940 # v1.0.0 | ||
with: | ||
subject-path: "dist/*.tar.gz" |
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