-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use goreleaser to autopopulate releases (#427)
Also includes building container images to ghcr.io Signed-off-by: Appu Goundan <appu@google.com>
- Loading branch information
1 parent
56b620a
commit 52e5d8e
Showing
3 changed files
with
87 additions
and
0 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,30 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
packages: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ structure_tests.test | |
.vscode | ||
out/ | ||
bazel-* | ||
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,56 @@ | ||
project_name: container-structure-test | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
|
||
main: ./cmd/container-structure-test | ||
|
||
binary: container-structure-test-{{.Os}}-{{.Arch}} | ||
|
||
ldflags: | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=12 | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate={{.Date}} | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.builtBy=goreleaser | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.commit={{.Commit}} | ||
|
||
targets: | ||
- darwin_amd64 | ||
- darwin_arm64 | ||
- linux_amd64 | ||
- linux_arm64 | ||
- linux_s390x | ||
- linux_ppc64le | ||
- windows_amd64 | ||
|
||
no_unique_dist_dir: true | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
archives: | ||
- format: binary | ||
name_template: "{{ .Binary }}" | ||
|
||
kos: | ||
- repository: ghcr.io/GoogleContainerTools/container-structure-test | ||
base_image: ubuntu:22.04 | ||
tags: | ||
- '{{.Version}}' | ||
- latest | ||
bare: true | ||
preserve_import_paths: false | ||
platforms: | ||
- linux/amd64 | ||
- linux/arm64 | ||
ldflags: | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=12 | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.buildDate={{.Date}} | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.builtBy=goreleaser | ||
- -X github.com/GoogleContainerTools/container-structure-test/pkg/version.commit={{.Commit}} | ||
|
||
release: | ||
footer: | | ||
## Container Images | ||
`ghcr.io/GoogleContainerTools/container-structure-test:{{.Version}}` |