Skip to content

Commit

Permalink
feat: support docker image arm64 arch (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed AbouZaid <[email protected]>
  • Loading branch information
aabouzaid authored Aug 20, 2024
1 parent a6f72ba commit f23287d
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 65 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tpl-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5
with:
Expand Down
100 changes: 100 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
version: 2
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
upx:
- enabled: true
compress: "1"
archives:
- format_overrides:
- goos: windows
format: zip
dockers:
- use: buildx
image_templates:
- "ghcr.io/devopshivehq/kustomize-generator-merger:latest-amd64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}-amd64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
# OCI annotations: https://github.com/opencontainers/image-spec/blob/main/annotations.md
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- use: buildx
image_templates:
- "ghcr.io/devopshivehq/kustomize-generator-merger:latest-arm64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}-arm64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}-arm64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64"
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
# OCI annotations: https://github.com/opencontainers/image-spec/blob/main/annotations.md
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
docker_manifests:
- name_template: "ghcr.io/devopshivehq/kustomize-generator-merger:latest"
image_templates:
- "ghcr.io/devopshivehq/kustomize-generator-merger:latest-amd64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:latest-arm64"
- name_template: "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}"
image_templates:
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}-amd64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}-arm64"
- name_template: "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}-arm64"
- name_template: "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
image_templates:
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
- "ghcr.io/devopshivehq/kustomize-generator-merger:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64"
release:
github: {}
name_template: "{{ .Version }}"
prerelease: auto
mode: append
signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
certificate: '${artifact}.pem'
args:
- sign-blob
- '--yes'
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
artifacts: checksum
output: true
docker_signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
args:
- sign
- '--yes'
- '${artifact}'
artifacts: all
output: true
# Changelog is generated by release-please.
changelog:
disable: true
65 changes: 0 additions & 65 deletions .goreleaser.yml

This file was deleted.

0 comments on commit f23287d

Please sign in to comment.