Skip to content

Commit

Permalink
Merge pull request #81 from thegalactiks/goreleaser-sbom
Browse files Browse the repository at this point in the history
Goreleaser SBOM
  • Loading branch information
emmanuelgautier authored Sep 15, 2024
2 parents cb4a9d9 + 8cd85d9 commit a04b30a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:

permissions:
contents: write
id-token: write
packages: write
pull-requests: write

Expand Down Expand Up @@ -43,6 +44,12 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Install Cosign
uses: sigstore/cosign-installer@v3

- name: Install Syft
uses: anchore/sbom-action/download-syft@v0

- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
Expand Down
51 changes: 48 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
version: 2

project_name: giteway

before:
hooks:
- go mod tidy
Expand All @@ -8,6 +12,17 @@ builds:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

gomod:
proxy: true

checksum:
name_template: 'checksums.txt'

source:
enabled: true

archives:
- format: tar.gz
Expand All @@ -23,15 +38,34 @@ archives:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"

sboms:
- id: syft-archive
artifacts: archive

signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
certificate: "${artifact}.pem"
args:
- sign-blob
- "--output-certificate=${certificate}"
- "--output-signature=${signature}"
- "${artifact}"
- "--yes"
artifacts: checksum
output: true

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^.vscode"
- "^.github"

dockers:
- image_templates:
Expand All @@ -44,3 +78,14 @@ dockers:
- "ghcr.io/thegalactiks/giteway:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/thegalactiks/giteway:latest"
dockerfile: .docker/Dockerfile-goreleaser

docker_signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
artifacts: images
output: true
args:
- "sign"
- "${artifact}"
- "--yes"

0 comments on commit a04b30a

Please sign in to comment.