Skip to content

Commit

Permalink
Build ARM images and release multi-arch manifests (#102)
Browse files Browse the repository at this point in the history
* Build ARM images and release multi-arch manifests

* Use correct (?) base image

* Install QEMU

* Also use QEMU in test-build job
  • Loading branch information
martin-helmich authored Oct 12, 2021
1 parent c178a73 commit 37cb9e4
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 25 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/release_tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,32 @@ jobs:
name: Build and release stable image
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
-
name: Docker login
- name: Docker login
run: docker login -u "${{ secrets.QUAY_IO_USER }}" -p "${{ secrets.QUAY_IO_TOKEN }}" quay.io
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: "0.176.0"
version: "0.181.1"
args: release --rm-dist -f build/ci/.goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }}

- name: Run chart version bump
uses: mittwald/bump-app-version-action@v1
with:
mode: 'publish'
chartYaml: './chart/Chart.yaml'
env:
GITHUB_TOKEN: "${{ secrets.RELEASE_USER_TOKEN }}"
HELM_REPO_PASSWORD: "${{ secrets.HELM_REPO_PASSWORD }}"
HELM_REPO_PASSWORD: "${{ secrets.HELM_REPO_PASSWORD }}"
15 changes: 8 additions & 7 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: "0.176.0"
version: "0.181.1"
args: release -f build/ci/.goreleaser.yml --snapshot --skip-publish --rm-dist
55 changes: 49 additions & 6 deletions build/ci/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ builds:
- linux
goarch:
- amd64
- arm64
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -27,14 +28,56 @@ changelog:
dockers:
-
image_templates:
- quay.io/mittwald/kube-httpcache:latest
- quay.io/mittwald/kube-httpcache:v{{ .Major }}
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}
- quay.io/mittwald/kube-httpcache:{{ .Tag }}
- quay.io/mittwald/kube-httpcache:stable
- quay.io/mittwald/kube-httpcache:latest-amd64
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-amd64
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-amd64
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-amd64
- quay.io/mittwald/kube-httpcache:stable-amd64
use: buildx
dockerfile: build/package/docker/GoReleaser.Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=ARCH=amd64/"
ids:
- kube-httpcache
goos: linux
goarch: amd64
goarm: ''
goarm: ''
-
image_templates:
- quay.io/mittwald/kube-httpcache:latest-arm64
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-arm64
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-arm64
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-arm64
- quay.io/mittwald/kube-httpcache:stable-arm64
use: buildx
dockerfile: build/package/docker/GoReleaser.Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--build-arg=ARCH=arm64v8/"
ids:
- kube-httpcache
goos: linux
goarch: arm64
goarm: ''
docker_manifests:
- name_template: quay.io/mittwald/kube-httpcache:latest
image_templates:
- quay.io/mittwald/kube-httpcache:latest-amd64
- quay.io/mittwald/kube-httpcache:latest-arm64
- name_template: quay.io/mittwald/kube-httpcache:stable
image_templates:
- quay.io/mittwald/kube-httpcache:stable-amd64
- quay.io/mittwald/kube-httpcache:stable-arm64
- name_template: quay.io/mittwald/kube-httpcache:v{{ .Major }}
image_templates:
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-amd64
- quay.io/mittwald/kube-httpcache:v{{ .Major }}-arm64
- name_template: quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}
image_templates:
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-amd64
- quay.io/mittwald/kube-httpcache:v{{ .Major }}.{{ .Minor }}-arm64
- name_template: quay.io/mittwald/kube-httpcache:{{ .Tag }}
image_templates:
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-amd64
- quay.io/mittwald/kube-httpcache:{{ .Tag }}-arm64
3 changes: 2 additions & 1 deletion build/package/docker/GoReleaser.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM debian:stretch-slim
ARG ARCH=
FROM ${ARCH}debian:stretch-slim

ENV EXPORTER_VERSION=1.6

Expand Down

0 comments on commit 37cb9e4

Please sign in to comment.