Skip to content

Release

Release #58

Workflow file for this run

name: Release
env:
IMAGE_NAME: activemq-artemis-broker
on:
workflow_dispatch:
inputs:
trigger_children:
description: 'Trigger children'
required: false
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install prerequisites
run: >
sudo apt-get update &&
sudo apt-get install gcc libkrb5-dev pass &&
sudo pip install docker==5.0.3 docker-squash cekit odcs[client] packaging==21.3
- name: Checkout the repo
uses: actions/checkout@v4
- name: Create release tag
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
git fetch --tags
HEAD_COMMIT="$(git rev-parse HEAD)"
RELEASE_TAG="$(grep -Po -m 1 '(?<=^version: ")[^"]+' image.yaml)"
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
git log
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build the image
run: |
cekit --verbose build --dry-run podman
podman build --platform linux/amd64 --platform linux/arm64 --manifest $IMAGE_NAME:latest ./target/image
- name: Push the image
run: |
git log
IMAGE_TAG="$(git describe --exact-match --tags | sed 's/v//')"
echo "IMAGE_TAG: ${IMAGE_TAG}"
ARTEMIS_TAG="artemis.$(podman image inspect $IMAGE_NAME:latest | grep -Po -m 1 '(?<=APACHE_ARTEMIS_VERSION=)[^"]*')"
echo "ARTEMIS_TAG: ${ARTEMIS_TAG}"
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
- name: Trigger children
if: ${{ inputs.trigger_children }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'activemq-artemis-broker-kubernetes-image',
workflow_id: 'update.yml',
ref: 'main',
inputs: {
version: '*.*.+',
update_version: 'true',
base_image: 'latest',
update_base_image: 'true',
trigger_release: 'all'
}
});