Skip to content

Add a makefile command to assist with multi-arch builds #2

Add a makefile command to assist with multi-arch builds

Add a makefile command to assist with multi-arch builds #2

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
bump-type:
type: choice
description: The position of the version to be bumped.
options:
- patch
- minor
- major
tag_to_move:
type: choice
description: The generic tag to be advanced.
options:
- v1
jobs:
test-and-lint:
name: Test and Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Lint
run: make lint
- name: Test
run: make test
multi-arch-build-and-push:
name: Build Multi Arch Containers
runs-on: ubuntu-latest
needs: [test-and-lint]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker Login
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: ${{ github.event.inputs.bump-type }}
- name: Build Release Container
env:
VERSION: ${{ steps.tag_version.outputs.new_version }}
run: make buildx
- name: Move Generic Tag Version
advance-generic-tag:
runs-on: ubuntu-latest
needs: [multi-arch-build-and-push]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name "GitHub Action"
git config user.email "action@github.com"
- name: Tag new target
run: git tag -f ${{ github.event.inputs.tag_to_move }} ${{ github.event.inputs.target }}
- name: Push new tag
run: git push origin ${{ github.event.inputs.tag_to_move }} --force