Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker images for other architectures #2

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on:
push:
tags:
- v*
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Set up Go
uses: actions/setup-go@v1
Expand All @@ -19,14 +22,21 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Log into GitHub Container Registry
run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
32 changes: 24 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,29 @@ changelog:

dockers:
- image_templates:
- "ghcr.io/vilsol/yeet:{{ .Tag }}"
- "ghcr.io/vilsol/yeet:v{{ .Major }}"
- "ghcr.io/vilsol/yeet:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/vilsol/yeet:latest"
- "ghcr.io/astrofloof/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "ghcr.io/astrofloof/{{ .ProjectName }}:v{{ .Major }}-amd64"
- "ghcr.io/astrofloof/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/astrofloof/{{ .ProjectName }}:latest-amd64"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"

- image_templates:
- "ghcr.io/astrofloof/{{ .ProjectName }}:{{ .Tag }}-arm64v8"
- "ghcr.io/astrofloof/{{ .ProjectName }}:v{{ .Major }}-arm64v8"
- "ghcr.io/astrofloof/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-arm64v8"
- "ghcr.io/astrofloof/{{ .ProjectName }}:latest-arm64v8"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"