-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add goreleaser automatic release when a tag is placed.
- Loading branch information
Showing
6 changed files
with
142 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,39 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
# run only against tags | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
# packages: write | ||
# issues: write | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/e2e.yml | ||
|
||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
- uses: docker/setup-qemu-action@v3 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- uses: goreleaser/goreleaser-action@v5 | ||
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 |
---|---|---|
|
@@ -24,3 +24,5 @@ Dockerfile.cross | |
*.swp | ||
*.swo | ||
*~ | ||
|
||
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,91 @@ | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj | ||
|
||
version: 1 | ||
|
||
builds: | ||
- main: ./cmd | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
dockers: | ||
- image_templates: | ||
- 'sjorsgielen/backsnap-restic:latest-amd64' | ||
- 'sjorsgielen/backsnap-restic:{{ .Tag }}-amd64' | ||
dockerfile: 'Dockerfile.restic' | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/amd64" | ||
- image_templates: | ||
- 'sjorsgielen/backsnap-restic:latest-arm64' | ||
- 'sjorsgielen/backsnap-restic:{{ .Tag }}-arm64' | ||
dockerfile: 'Dockerfile.restic' | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/arm64" | ||
goarch: arm64 | ||
- image_templates: | ||
- 'sjorsgielen/backsnap:latest-amd64' | ||
- 'sjorsgielen/backsnap:{{ .Tag }}-amd64' | ||
dockerfile: 'Dockerfile.goreleaser' | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/amd64" | ||
- image_templates: | ||
- 'sjorsgielen/backsnap:latest-arm64' | ||
- 'sjorsgielen/backsnap:{{ .Tag }}-arm64' | ||
dockerfile: 'Dockerfile.goreleaser' | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/arm64" | ||
goarch: arm64 | ||
|
||
docker_manifests: | ||
- name_template: 'sjorsgielen/backsnap-restic:latest' | ||
image_templates: | ||
- 'sjorsgielen/backsnap-restic:latest-amd64' | ||
- 'sjorsgielen/backsnap-restic:latest-arm64' | ||
- name_template: 'sjorsgielen/backsnap-restic:{{ .Tag }}' | ||
image_templates: | ||
- 'sjorsgielen/backsnap-restic:{{ .Tag }}-amd64' | ||
- 'sjorsgielen/backsnap-restic:{{ .Tag }}-arm64' | ||
- name_template: 'sjorsgielen/backsnap:latest' | ||
image_templates: | ||
- 'sjorsgielen/backsnap:latest-amd64' | ||
- 'sjorsgielen/backsnap:latest-arm64' | ||
- name_template: 'sjorsgielen/backsnap:{{ .Tag }}' | ||
image_templates: | ||
- 'sjorsgielen/backsnap:{{ .Tag }}-amd64' | ||
- 'sjorsgielen/backsnap:{{ .Tag }}-arm64' | ||
|
||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of `uname`. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
# use zip for windows archives | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" |
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,8 @@ | ||
# Use distroless as minimal base image to package the manager binary | ||
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY backsnap manager | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/manager"] |
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