Add support for ghcr.io image tags (#383)

Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
This commit is contained in:
Jordan Jones
2025-04-15 19:36:44 -07:00
committed by GitHub
parent 0868f04de1
commit 9f6293025d
4 changed files with 67 additions and 14 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
release: release:
uses: itzg/github-workflows/.github/workflows/go-with-releaser-image.yml@main uses: itzg/github-workflows/.github/workflows/go-with-releaser-image.yml@main
with: with:
go-version: "1.24.1" go-version: "1.24.2"
secrets: secrets:
image-registry-username: ${{ secrets.DOCKERHUB_USERNAME }} image-registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
image-registry-password: ${{ secrets.DOCKERHUB_TOKEN }} image-registry-password: ${{ secrets.DOCKERHUB_TOKEN }}
+1 -1
View File
@@ -11,4 +11,4 @@ jobs:
build: build:
uses: itzg/github-workflows/.github/workflows/go-test.yml@main uses: itzg/github-workflows/.github/workflows/go-test.yml@main
with: with:
go-version: "1.24.1" go-version: "1.24.2"
+64 -11
View File
@@ -6,11 +6,11 @@ release:
before: before:
hooks: hooks:
- go mod download - go mod download
brews:
- install: |
bin.install "mc-router"
builds: builds:
- goos: - id: mc-router
main: ./cmd/mc-router
binary: mc-router
goos:
- linux - linux
- darwin - darwin
- windows - windows
@@ -19,14 +19,12 @@ builds:
- arm64 - arm64
- arm - arm
goarm: goarm:
- 6 - "6"
ignore: ignore:
- goos: windows - goos: windows
goarch: arm goarch: arm
- goos: windows - goos: windows
goarch: arm64 goarch: arm64
main: ./cmd/mc-router
binary: mc-router
env: env:
- CGO_ENABLED=0 - CGO_ENABLED=0
archives: archives:
@@ -40,22 +38,28 @@ archives:
- README* - README*
snapshot: snapshot:
name_template: SNAPSHOT-{{ .ShortCommit }} name_template: SNAPSHOT-{{ .ShortCommit }}
brews:
- install: |
bin.install "mc-router"
dockers: dockers:
- image_templates: - image_templates:
- "itzg/{{ .ProjectName }}:{{ .Version }}-amd64" - "itzg/{{ .ProjectName }}:{{ .Version }}-amd64"
- "itzg/{{ .ProjectName }}:latest-amd64"
dockerfile: Dockerfile.release dockerfile: Dockerfile.release
goarch: amd64 goarch: amd64
use: buildx
build_flag_templates: build_flag_templates:
- --platform - --platform
- linux/amd64 - linux/amd64
- --load - --load
- --label=org.opencontainers.image.version={{ .Version }} - --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.revision={{ .FullCommit }}
- image_templates: - image_templates:
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm64" - "itzg/{{ .ProjectName }}:{{ .Version }}-arm64"
- "itzg/{{ .ProjectName }}:latest-arm64"
dockerfile: Dockerfile.release dockerfile: Dockerfile.release
goarch: arm64 goarch: arm64
use: buildx
build_flag_templates: build_flag_templates:
- --platform - --platform
- linux/arm64 - linux/arm64
@@ -64,9 +68,48 @@ dockers:
- --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.revision={{ .FullCommit }}
- image_templates: - image_templates:
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6" - "itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6"
- "itzg/{{ .ProjectName }}:latest-arm32v6"
dockerfile: Dockerfile.release dockerfile: Dockerfile.release
goarch: arm goarch: arm
goarm: "6" goarm: "6"
use: buildx
build_flag_templates:
- --platform
- linux/arm/v6
- --load
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- image_templates:
- "ghcr.io/itzg/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ghcr.io/itzg/{{ .ProjectName }}:latest-amd64"
dockerfile: Dockerfile.release
goarch: amd64
use: buildx
build_flag_templates:
- --platform
- linux/amd64
- --load
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- image_templates:
- "ghcr.io/itzg/{{ .ProjectName }}:{{ .Version }}-arm64"
- "ghcr.io/itzg/{{ .ProjectName }}:latest-arm64"
dockerfile: Dockerfile.release
goarch: arm64
use: buildx
build_flag_templates:
- --platform
- linux/arm64
- --load
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- image_templates:
- "ghcr.io/itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6"
- "ghcr.io/itzg/{{ .ProjectName }}:latest-arm32v6"
dockerfile: Dockerfile.release
goarch: arm
goarm: "6"
use: buildx
build_flag_templates: build_flag_templates:
- --platform - --platform
- linux/arm/v6 - linux/arm/v6
@@ -82,9 +125,19 @@ docker_manifests:
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6" - "itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6"
- name_template: "itzg/{{ .ProjectName }}:latest" - name_template: "itzg/{{ .ProjectName }}:latest"
image_templates: image_templates:
- "itzg/{{ .ProjectName }}:{{ .Version }}-amd64" - "itzg/{{ .ProjectName }}:latest-amd64"
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm64" - "itzg/{{ .ProjectName }}:latest-arm64"
- "itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6" - "itzg/{{ .ProjectName }}:latest-arm32v6"
- name_template: "ghcr.io/itzg/{{ .ProjectName }}:{{ .Version }}"
image_templates:
- "ghcr.io/itzg/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ghcr.io/itzg/{{ .ProjectName }}:{{ .Version }}-arm64"
- "ghcr.io/itzg/{{ .ProjectName }}:{{ .Version }}-arm32v6"
- name_template: "ghcr.io/itzg/{{ .ProjectName }}:latest"
image_templates:
- "ghcr.io/itzg/{{ .ProjectName }}:latest-amd64"
- "ghcr.io/itzg/{{ .ProjectName }}:latest-arm64"
- "ghcr.io/itzg/{{ .ProjectName }}:latest-arm32v6"
changelog: changelog:
filters: filters:
exclude: exclude:
+1 -1
View File
@@ -2,7 +2,7 @@ module github.com/itzg/mc-router
go 1.23.0 go 1.23.0
toolchain go1.24.1 toolchain go1.24.2
require ( require (
github.com/go-kit/kit v0.13.0 github.com/go-kit/kit v0.13.0