-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (43 loc) · 1.88 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Release
env:
IMAGE_NAME: activemq-artemis-broker-init
on:
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@v4
- 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 '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@v3
- 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