-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SKIP-956] Versioning for Skiperator (#206)
* add wip goreleaser file Signed-off-by: anderssonw <[email protected]> * update goreleaser Signed-off-by: anderssonw <[email protected]> * goreleaser action Signed-off-by: anderssonw <[email protected]> * add files for docker image Signed-off-by: anderssonw <[email protected]> * update goreleaser syntax * set full image template for ghcr * test using github token env var * revert * use ghcr.io * use coinciding names for archive and build, see if it works * remove changelog, does not exist * add cosign blob sign to goreleaser * add -y flag for cosign * remove deploy on tag push * add syft for sbom and image templates * Add version information to binary * Attempt DOCKER_EXPERIMENTAL * Enable BuildKit * try setting up qemu and docker buildx too * remove attempt at multiarch images * add docker signatures with cosign and image template to dockers field * set same id for build, archive and docker * remove docker_template it no worky --------- Signed-off-by: anderssonw <[email protected]> Co-authored-by: Even Holthe <[email protected]>
- Loading branch information
1 parent
7db0608
commit 1cac323
Showing
5 changed files
with
127 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
DOCKER_EXPERIMENTAL: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- run: git fetch --force --tags | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: stable | ||
|
||
- name: Log into GHCR registry | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install Cosign | ||
uses: sigstore/[email protected] | ||
|
||
- name: Install Syft for SBOM Generation | ||
shell: bash | ||
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin | ||
|
||
- name: Release with Goreleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
/kubeconfig | ||
|
||
.vscode/ | ||
.idea/ | ||
.idea/ | ||
dist/ |
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 @@ | ||
project_name: skiperator | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
binary: bin/skiperator | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- -s -w -X main.Version={{.Version}} -X main.Commit={{.ShortCommit}} | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: i386 | ||
tags: | ||
- osusergo | ||
- netgo | ||
main: ./cmd/skiperator/ | ||
id: skiperator | ||
|
||
archives: | ||
- id: skiperator | ||
builds: | ||
- skiperator | ||
files: | ||
- README.md | ||
|
||
dockers: | ||
- extra_files: | ||
- ./ | ||
dockerfile: Dockerfile | ||
ids: | ||
- skiperator | ||
|
||
docker_signs: | ||
- artifacts: all | ||
cmd: cosign | ||
args: | ||
- "sign" | ||
- "--oidc-issuer=https://token.actions.githubusercontent.com" | ||
- "${artifact}" | ||
- "--yes" | ||
|
||
signs: | ||
- artifacts: all | ||
cmd: cosign | ||
signature: "${artifact}.sig" | ||
args: | ||
- "sign-blob" | ||
- "--oidc-issuer=https://token.actions.githubusercontent.com" | ||
- "--output-signature=${signature}" | ||
- "${artifact}" | ||
- "--yes" | ||
|
||
sboms: | ||
- artifacts: archive | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
snapshot: | ||
name_template: "{{ .Tag }}-dev" | ||
changelog: | ||
sort: asc |
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