Skip to content

Release

Release #90

Workflow file for this run

name: Release
env:
IMAGE_NAME: arkmq-org-broker-init
on:
workflow_dispatch:
inputs:
force_release_tag:
description: 'Force release tag'
required: true
default: false
type: boolean
trigger_children:
description: 'Trigger children'
required: false
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v6
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Create release tag
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
git fetch --tags
HEAD_COMMIT="$(git rev-parse HEAD)"
RELEASE_TAG="$(grep -m 1 -oP '(?<=LABEL version=")[^"]+' Dockerfile)"
RELEASE_TAG_COMMIT="$(git rev-list -n 1 ${RELEASE_TAG} || true)"
if [ "$RELEASE_TAG_COMMIT" != "$HEAD_COMMIT" ]; then
git config user.name 'arkmq-bot'
git config user.email 'bot@arkmq-org.io'
git tag -a ${RELEASE_TAG} -m ${RELEASE_TAG} $([ "${{ inputs.force_release_tag }}" = "true" ] && echo '--force')
git push origin $RELEASE_TAG --force
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Build the image
run: |
podman build --no-cache --platform linux/amd64 --platform linux/arm64 --manifest $IMAGE_NAME:latest .
- name: Push the image
run: |
IMAGE_TAG="$(git describe --exact-match --tags | sed 's/v//')"
ARTEMIS_TAG="artemis.$(podman image inspect $IMAGE_NAME:latest | grep -Po -m 1 '(?<=APACHE_ARTEMIS_VERSION=)[^"]*')"
podman login --username=${{ secrets.QUAY_USERNAME }} --password=${{ secrets.QUAY_PASSWORD }} quay.io
podman manifest push $IMAGE_NAME:latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:latest
podman manifest push $IMAGE_NAME:latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:$IMAGE_TAG
podman manifest push $IMAGE_NAME:latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:$ARTEMIS_TAG