Release #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
env: | |
IMAGE_NAME: activemq-artemis-broker-init | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
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@v2 | |
- name: Create release tag | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
git fetch --tags | |
HEAD_COMMIT="$(git rev-parse HEAD)" | |
RELEASE_TAG="v$(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 'artemiscloud-bot' | |
git config user.email '[email protected]' | |
git tag -a ${RELEASE_TAG} -m ${RELEASE_TAG} --force | |
git push origin $RELEASE_TAG --force | |
fi | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- 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 |