Skip to content

Commit 37cb9e4

Browse files
Build ARM images and release multi-arch manifests (#102)
* Build ARM images and release multi-arch manifests * Use correct (?) base image * Install QEMU * Also use QEMU in test-build job
1 parent c178a73 commit 37cb9e4

File tree

4 files changed

+69
-25
lines changed

4 files changed

+69
-25
lines changed

.github/workflows/release_tags.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,32 @@ jobs:
1010
name: Build and release stable image
1111
runs-on: ubuntu-latest
1212
steps:
13-
-
14-
name: Checkout
13+
- name: Checkout
1514
uses: actions/checkout@v2
1615
with:
1716
fetch-depth: 0
18-
-
19-
name: Set up Go
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@master
19+
with:
20+
platforms: all
21+
- name: Set up Go
2022
uses: actions/setup-go@v2
2123
with:
2224
go-version: 1.14
23-
-
24-
name: Docker login
25+
- name: Docker login
2526
run: docker login -u "${{ secrets.QUAY_IO_USER }}" -p "${{ secrets.QUAY_IO_TOKEN }}" quay.io
26-
-
27-
name: Run GoReleaser
27+
- name: Run GoReleaser
2828
uses: goreleaser/goreleaser-action@v2
2929
with:
30-
version: "0.176.0"
30+
version: "0.181.1"
3131
args: release --rm-dist -f build/ci/.goreleaser.yml
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }}
34-
3534
- name: Run chart version bump
3635
uses: mittwald/bump-app-version-action@v1
3736
with:
3837
mode: 'publish'
3938
chartYaml: './chart/Chart.yaml'
4039
env:
4140
GITHUB_TOKEN: "${{ secrets.RELEASE_USER_TOKEN }}"
42-
HELM_REPO_PASSWORD: "${{ secrets.HELM_REPO_PASSWORD }}"
41+
HELM_REPO_PASSWORD: "${{ secrets.HELM_REPO_PASSWORD }}"

.github/workflows/test_build.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,20 @@ jobs:
3131
name: Build
3232
runs-on: ubuntu-latest
3333
steps:
34-
-
35-
name: Checkout
34+
- name: Checkout
3635
uses: actions/checkout@v2
3736
with:
3837
fetch-depth: 0
39-
-
40-
name: Set up Go
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@master
40+
with:
41+
platforms: all
42+
- name: Set up Go
4143
uses: actions/setup-go@v2
4244
with:
4345
go-version: 1.14
44-
-
45-
name: Run GoReleaser
46+
- name: Run GoReleaser
4647
uses: goreleaser/goreleaser-action@v2
4748
with:
48-
version: "0.176.0"
49+
version: "0.181.1"
4950
args: release -f build/ci/.goreleaser.yml --snapshot --skip-publish --rm-dist

build/ci/.goreleaser.yml

+49-6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ builds:
1414
- linux
1515
goarch:
1616
- amd64
17+
- arm64
1718
checksum:
1819
name_template: 'checksums.txt'
1920
snapshot:
@@ -27,14 +28,56 @@ changelog:
2728
dockers:
2829
-
2930
image_templates:
30-
- quay.io/mittwald/kube-httpcache:latest
31-
- quay.io/mittwald/kube-httpcache:v{{ .Major }}
32-
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}
33-
- quay.io/mittwald/kube-httpcache:{{ .Tag }}
34-
- quay.io/mittwald/kube-httpcache:stable
31+
- quay.io/mittwald/kube-httpcache:latest-amd64
32+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-amd64
33+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-amd64
34+
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-amd64
35+
- quay.io/mittwald/kube-httpcache:stable-amd64
36+
use: buildx
3537
dockerfile: build/package/docker/GoReleaser.Dockerfile
38+
build_flag_templates:
39+
- "--platform=linux/amd64"
40+
- "--build-arg=ARCH=amd64/"
3641
ids:
3742
- kube-httpcache
3843
goos: linux
3944
goarch: amd64
40-
goarm: ''
45+
goarm: ''
46+
-
47+
image_templates:
48+
- quay.io/mittwald/kube-httpcache:latest-arm64
49+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-arm64
50+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-arm64
51+
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-arm64
52+
- quay.io/mittwald/kube-httpcache:stable-arm64
53+
use: buildx
54+
dockerfile: build/package/docker/GoReleaser.Dockerfile
55+
build_flag_templates:
56+
- "--platform=linux/arm64/v8"
57+
- "--build-arg=ARCH=arm64v8/"
58+
ids:
59+
- kube-httpcache
60+
goos: linux
61+
goarch: arm64
62+
goarm: ''
63+
docker_manifests:
64+
- name_template: quay.io/mittwald/kube-httpcache:latest
65+
image_templates:
66+
- quay.io/mittwald/kube-httpcache:latest-amd64
67+
- quay.io/mittwald/kube-httpcache:latest-arm64
68+
- name_template: quay.io/mittwald/kube-httpcache:stable
69+
image_templates:
70+
- quay.io/mittwald/kube-httpcache:stable-amd64
71+
- quay.io/mittwald/kube-httpcache:stable-arm64
72+
- name_template: quay.io/mittwald/kube-httpcache:v{{ .Major }}
73+
image_templates:
74+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-amd64
75+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-arm64
76+
- name_template: quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}
77+
image_templates:
78+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-amd64
79+
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-arm64
80+
- name_template: quay.io/mittwald/kube-httpcache:{{ .Tag }}
81+
image_templates:
82+
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-amd64
83+
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-arm64

build/package/docker/GoReleaser.Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM debian:stretch-slim
1+
ARG ARCH=
2+
FROM ${ARCH}debian:stretch-slim
23

34
ENV EXPORTER_VERSION=1.6
45

0 commit comments

Comments
 (0)