Skip to content

Release

Release #37

Workflow file for this run

name: Release
env:
IMAGE_NAME: activemq-artemis-operator
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install prerequisites
run: sudo apt-get install pass
- 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 '(?<=Version = ")[^"]+' version/version.go)"
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 'bot@artemiscloud.io'
git tag -a ${RELEASE_TAG} -m ${RELEASE_TAG} --force
git push origin $RELEASE_TAG --force
fi
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Check doc.crds.dev
run: for i in {1..30}; do curl "https://doc.crds.dev/github.com/${{ github.repository }}@${{ github.ref_name }}" | grep 'ActiveMQArtemis' && break; sleep 1; done
- name: Checkout artemiscloud.github.io
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/artemiscloud.github.io
path: artemiscloud.github.io
token: ${{ secrets.BOT_TOKEN }}
- name: Build the docs
run: >
rm -rf artemiscloud.github.io/content/en/docs &&
cp -r docs artemiscloud.github.io/content/en &&
cd artemiscloud.github.io &&
npm install && npm run build
- name: Push the docs
run: >
cd artemiscloud.github.io &&
git config user.name 'ArtemisCloud Bot' &&
git config user.email 'artemiscloudbot@users.noreply.github.com' &&
git add --all && git commit --all --allow-empty --message 'Update docs to ${{ github.ref_name }}' && git push
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Build the image
run: |
#podman build --no-cache --platform linux/amd64 --tag $IMAGE_NAME:latest-linux/amd64 .
podman build --no-cache --platform linux/arm64 --tag $IMAGE_NAME:latest-linux-arm64 .
#podman manifest create $IMAGE_NAME:latest $IMAGE_NAME:latest-linux-amd64 $IMAGE_NAME:latest-linux-arm64
podman manifest create $IMAGE_NAME:latest $IMAGE_NAME:latest-linux-arm64
- name: Push the image
run: |
IMAGE_TAG="$(git describe --exact-match --tags | sed 's/v//')"
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
- name: Build the bundle image
run: export BUNDLE_IMG=$IMAGE_NAME-bundle:latest && make bundle-build
- name: Push the bundle image
run: >
RELEASE_TAG="$(git describe --exact-match --tags)" && IMAGE_TAG=${RELEASE_TAG#v} &&
docker login --username=${{ secrets.QUAY_USERNAME }} --password=${{ secrets.QUAY_PASSWORD }} quay.io &&
docker tag $IMAGE_NAME-bundle:latest quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:$IMAGE_TAG &&
docker push quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:$IMAGE_TAG &&
docker tag $IMAGE_NAME-bundle:latest quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:latest &&
docker push quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME-bundle:latest