chore: upgrade to goreleaser v2 (#1208)
Docs / build (push) Waiting to run
Docs / deploy (push) Blocked by required conditions
Release Please / release-please (push) Waiting to run
Release Preview / call-reusable-release (push) Waiting to run
Test / test-nix (push) Waiting to run
Test / test-win (push) Waiting to run

Co-authored-by: Gareth <garethgeorge97@gmail.com>
This commit is contained in:
avery
2026-05-03 06:51:23 +01:00
committed by GitHub
parent b98b1dc3cc
commit d6f6875771
5 changed files with 54 additions and 269 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
+42 -259
View File
@@ -1,4 +1,4 @@
version: 1
version: 2
env:
- BACKREST_BUILD_VERSION={{.Version}}
@@ -77,11 +77,12 @@ builds:
archives:
- id: default
builds:
ids:
- other
- linux
- windows
format: tar.gz
formats:
- tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
@@ -91,7 +92,7 @@ archives:
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip
formats: zip
files:
- install.sh
- uninstall.sh
@@ -100,274 +101,56 @@ archives:
- CHANGELOG.md
allow_different_binary_count: true
dockers:
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-alpine-amd64
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64
dockers_v2:
- id: alpine
images:
- "garethgeorge/backrest"
- "ghcr.io/garethgeorge/backrest"
tags:
- latest
- latest-alpine
- v{{ .Major }}
- v{{ .Major }}.{{ .Minor }}
- "{{ .Tag }}"
- "{{ .Tag }}-alpine"
dockerfile: Dockerfile.alpine
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-alpine-arm64
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64
dockerfile: Dockerfile.alpine
goarch: arm64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-alpine-armv6
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv6
dockerfile: Dockerfile.alpine
use: buildx
goarch: arm
goarm: 6
build_flag_templates:
flags:
- "--pull"
# provenance attestations break the multi-arch manifest for armv6/armv7/386
- "--provenance=false"
- "--platform=linux/arm/v6"
ids:
- linux
- docker-entrypoint
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v6
- linux/arm/v7
- linux/386
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-alpine-armv7
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv7
dockerfile: Dockerfile.alpine
use: buildx
goarch: arm
goarm: 7
build_flag_templates:
- "--pull"
- "--provenance=false"
- "--platform=linux/arm/v7"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-alpine-386
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-386
dockerfile: Dockerfile.alpine
use: buildx
goarch: "386"
goarm: 7
build_flag_templates:
- "--pull"
- "--provenance=false"
- "--platform=linux/386"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-scratch-arm64
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64
- id: scratch
images:
- garethgeorge/backrest
- ghcr.io/garethgeorge/backrest
tags:
- scratch
- v{{ .Major }}-scratch
- v{{ .Major }}.{{ .Minor }}-scratch
- "{{ .Tag }}-scratch"
dockerfile: Dockerfile.scratch
goarch: arm64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-scratch-amd64
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64
dockerfile: Dockerfile.scratch
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-scratch-armv6
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6
dockerfile: Dockerfile.scratch
use: buildx
goarch: arm
goarm: 6
build_flag_templates:
flags:
- "--pull"
# provenance attestations break the multi-arch manifest for armv6/armv7/386
- "--provenance=false"
- "--platform=linux/arm/v6"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-scratch-armv7
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv7
dockerfile: Dockerfile.scratch
use: buildx
goarch: arm
goarm: 7
build_flag_templates:
- "--pull"
- "--provenance=false"
- "--platform=linux/arm/v7"
ids:
- linux
- docker-entrypoint
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-scratch-386
- ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-386
dockerfile: Dockerfile.scratch
use: buildx
goarch: "386"
goarm: 7
build_flag_templates:
- "--pull"
- "--provenance=false"
- "--platform=linux/386"
ids:
- linux
- docker-entrypoint
docker_manifests:
- name_template: "garethgeorge/backrest:latest"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "ghcr.io/garethgeorge/backrest:latest"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "garethgeorge/backrest:v{{ .Major }}"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "garethgeorge/backrest:{{ .Tag }}"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "ghcr.io/garethgeorge/backrest:{{ .Tag }}"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "garethgeorge/backrest:latest-alpine"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "ghcr.io/garethgeorge/backrest:latest-alpine"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-alpine-386"
- name_template: "garethgeorge/backrest:scratch"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "garethgeorge/backrest:{{ .Tag }}-scratch-386"
- name_template: "ghcr.io/garethgeorge/backrest:scratch"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-386"
- name_template: "garethgeorge/backrest:v{{ .Major }}-scratch"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "garethgeorge/backrest:{{ .Tag }}-scratch-386"
- name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}-scratch"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-386"
- name_template: "garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}-scratch"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "garethgeorge/backrest:{{ .Tag }}-scratch-386"
- name_template: "ghcr.io/garethgeorge/backrest:v{{ .Major }}.{{ .Minor }}-scratch"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-386"
- name_template: "garethgeorge/backrest:{{ .Tag }}-scratch"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "garethgeorge/backrest:{{ .Tag }}-scratch-386"
- name_template: "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch"
image_templates:
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv6"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-armv7"
- "ghcr.io/garethgeorge/backrest:{{ .Tag }}-scratch-386"
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v6
- linux/arm/v7
- linux/386
brews:
- name: backrest
+4 -3
View File
@@ -4,9 +4,10 @@ RUN apk --no-cache add tini ca-certificates curl bash rclone openssh tzdata dock
rclone selfupdate --stable
RUN mkdir -p /tmp
# Copy the binary we built via goreleaser
COPY backrest /backrest
COPY docker-entrypoint /docker-entrypoint
ARG TARGETPLATFORM
# Binaries are staged per-platform by goreleaser dockers_v2
COPY $TARGETPLATFORM/backrest /backrest
COPY $TARGETPLATFORM/docker-entrypoint /docker-entrypoint
# Run the binary to install dependencies (may run via QEMU but necessary)
RUN /backrest --install-deps-only
+6 -5
View File
@@ -3,8 +3,9 @@ FROM alpine:latest AS alpine
RUN apk add --no-cache ca-certificates tini-static
RUN mkdir /tmp-orig
# Copy binary from goreleaser to run install-deps
COPY backrest /backrest
ARG TARGETPLATFORM
# Binaries are staged per-platform by goreleaser dockers_v2
COPY $TARGETPLATFORM/backrest /backrest
RUN /backrest --install-deps-only
# Setup restic path
@@ -20,9 +21,9 @@ COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=alpine /bin/restic /bin/restic
COPY --from=alpine /sbin/tini-static /tini
# Copy binaries from goreleaser
COPY backrest /backrest
COPY docker-entrypoint /docker-entrypoint
ARG TARGETPLATFORM
COPY $TARGETPLATFORM/backrest /backrest
COPY $TARGETPLATFORM/docker-entrypoint /docker-entrypoint
ENTRYPOINT ["/tini", "--", "/docker-entrypoint"]
CMD ["/backrest"]
+1 -1
View File
@@ -266,7 +266,7 @@ If you prefer not to use Nix, install the following manually:
- [Go](https://go.dev/) 1.24 or greater
- [Node.js](https://nodejs.org/en) 20.x and [pnpm](https://pnpm.io/) 9
- [goreleaser](https://github.com/goreleaser/goreleaser) `go install github.com/goreleaser/goreleaser@latest`
- [goreleaser](https://github.com/goreleaser/goreleaser) `go install github.com/goreleaser/goreleaser/v2@latest`
**(Optional) To edit protobuf definitions:**