-
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 #21 from eddort/refactor/container
Refactor/container
- Loading branch information
Showing
5 changed files
with
136 additions
and
66 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,19 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
cache: true | ||
- run: go test -v ./... |
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,35 @@ | ||
# | ||
# Releaser workflow setup | ||
# https://goreleaser.com/ci/actions/ | ||
# | ||
name: release | ||
|
||
# run only on tags | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write # needed to write releases | ||
id-token: write # needed for keyless signing | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # this is important, otherwise it won't checkout the full tree (i.e. no previous tags) | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
cache: true | ||
- uses: sigstore/[email protected] # installs cosign | ||
- uses: anchore/sbom-action/[email protected] # installs syft | ||
- uses: goreleaser/goreleaser-action@v6 # run goreleaser | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,69 @@ | ||
# | ||
# Example keyless signing with SBOMs goreleaser config. | ||
# | ||
# See also: .github/workflows/release.yml | ||
|
||
version: 2 | ||
|
||
project_name: supply-chain-example | ||
|
||
# setups builds for linux and darwin on amd64 and arm64 | ||
# https://goreleaser.com/customization/build | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
# ensures mod timestamp to be the commit timestamp | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
flags: | ||
# trims path | ||
- -trimpath | ||
ldflags: | ||
# use commit date instead of current date as main.date | ||
# only needed if you actually use those things in your main package, otherwise can be ignored. | ||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} | ||
|
||
# proxies from the go mod proxy before building | ||
# https://goreleaser.com/customization/gomod | ||
gomod: | ||
proxy: true | ||
|
||
# config the checksum filename | ||
# https://goreleaser.com/customization/checksum | ||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
# create a source tarball | ||
# https://goreleaser.com/customization/source/ | ||
source: | ||
enabled: true | ||
|
||
# creates SBOMs of all archives and the source tarball using syft | ||
# https://goreleaser.com/customization/sbom | ||
sboms: | ||
- artifacts: archive | ||
- id: source # Two different sbom configurations need two different IDs | ||
artifacts: source | ||
|
||
# signs the checksum file | ||
# all files (including the sboms) are included in the checksum, so we don't need to sign each one if we don't want to | ||
# https://goreleaser.com/customization/sign | ||
signs: | ||
- cmd: cosign | ||
env: | ||
- COSIGN_EXPERIMENTAL=1 | ||
certificate: "${artifact}.pem" | ||
args: | ||
- sign-blob | ||
- "--output-certificate=${certificate}" | ||
- "--output-signature=${signature}" | ||
- "${artifact}" | ||
- "--yes" # needed on cosign 2.0.0+ | ||
artifacts: checksum | ||
output: true | ||
|
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