Skip to content

Commit

Permalink
Test multi arch build
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Petrausch committed Feb 3, 2021
1 parent 4a90c02 commit 61ef50a
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
run: go test -cover ./...
- name: Vet
run: go vet ./...
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Login to the registries
- name: Login to Github Packages
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release

on:
push:
branches: ["master"]
pull_request:

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15.x
- name: Test
run: go test -cover ./...
- name: Vet
run: go vet ./...
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist --skip-publish
39 changes: 37 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,44 @@ changelog:
dockers:
- dockerfile: release/Dockerfile.scratch
image_templates:
- "hikhvar/mqtt2prometheus:{{ .Tag }}"
- "hikhvar/mqtt2prometheus:latest"
- "docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:{{ .Tag }}"
- "docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:latest"
- "ghcr.io/hikhvar/mqtt2prometheus:{{ .Tag }}"
- "ghcr.io/hikhvar/mqtt2prometheus:latest"
- "ghcr.io/hikhvar/mqtt2prometheus:latest"

- dockerfile: release/Dockerfile.scratch
goos: linux
goarch: amd64
image_templates:
- "hikhvar/mqtt2prometheus:{{ .Tag }}-amd64"
- "hikhvar/mqtt2prometheus:latest}-amd64"
- "docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:{{ .Tag }}}-amd64"
- "docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:latest}-amd64"
- "ghcr.io/hikhvar/mqtt2prometheus:{{ .Tag }}}-amd64"
- "ghcr.io/hikhvar/mqtt2prometheus:latest}-amd64"

- dockerfile: release/Dockerfile.scratch
goos: linux
goarch: arm64
image_templates:
- "hikhvar/mqtt2prometheus:{{ .Tag }}-arm64"
- "hikhvar/mqtt2prometheus:latest}-arm64"
- "docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:{{ .Tag }}}-arm64"
- "docker.pkg.github.com/hikhvar/mqtt2prometheus/mqtt2prometheus:latest}-arm64"
- "ghcr.io/hikhvar/mqtt2prometheus:{{ .Tag }}}-arm64"
- "ghcr.io/hikhvar/mqtt2prometheus:latest}-arm64"

# .goreleaser.yml
docker_manifests:
# You can have multiple Docker manifests.
-
# Name template for the manifest.
# Defaults to empty.
name_template: hikhvar/mqtt2prometheus:{{ .Tag }}

# Image name templates to be added to this manifest.
# Defaults to empty.
image_templates:
- "hikhvar/mqtt2prometheus:{{ .Tag }}-amd64"
- "hikhvar/mqtt2prometheus:{{ .Tag }}-arm64"

0 comments on commit 61ef50a

Please sign in to comment.