Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
branches: [ "main" ]

env:
GO_VERSION: ~1.24
GO_VERSION: 'stable'
# Taken from https://github.com/kubernetes-sigs/kind/releases/tag/v0.18.0
# The image here should be listed under 'Images built for this release' for the version of kind in go.mod
KIND_NODE_IMAGE: "kindest/node:v1.32.0"
Expand Down Expand Up @@ -120,6 +120,7 @@ jobs:
permissions:
contents: 'write'
id-token: 'write'
packages: 'write'
steps:
- name: Checkout
uses: actions/checkout@v5
Expand All @@ -138,6 +139,7 @@ jobs:
images: |
rabbitmqoperator/cluster-operator
quay.io/rabbitmqoperator/cluster-operator
ghcr.io/rabbitmq/cluster-operator
# generate Docker tags based on the following events/attributes
tags: |
type=sha
Expand All @@ -151,20 +153,28 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay.io
if: github.event_name != 'pull_request'
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Login to GHCR
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: build
uses: docker/build-push-action@v6
Expand All @@ -176,6 +186,9 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# FIXME: mount cache in the container
# https://github.com/reproducible-containers/buildkit-cache-dance
# https://docs.docker.com/build/ci/github-actions/cache/#cache-mounts
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down Expand Up @@ -207,8 +220,7 @@ jobs:
pushd config/installation
kustomize edit set image rabbitmqoperator/cluster-operator-dev=rabbitmqoperator/cluster-operator:"${RELEASE_VERSION}"
popd
make generate-installation-manifest QUAY_IO_OPERATOR_IMAGE=quay.io/rabbitmqoperator/cluster-operator:"${RELEASE_VERSION}"
echo -n "cluster-operator-${{ steps.meta.outputs.version }}.yml" > "latest-cluster-operator-dev-manifest.txt"
make generate-installation-manifest QUAY_IO_OPERATOR_IMAGE=quay.io/rabbitmqoperator/cluster-operator:"${RELEASE_VERSION}" GHCR_IO_OPERATOR_IMAGE=ghcr.io/rabbitmq/cluster-operator:"${RELEASE_VERSION}"

- name: Upload operator manifests
uses: actions/upload-artifact@v4
Expand All @@ -227,7 +239,7 @@ jobs:
rabbitmq-image:
- rabbitmq:3.13.7-management
- rabbitmq:management
- pivotalrabbitmq/rabbitmq:main
- pivotalrabbitmq/rabbitmq:main-otp27
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v5
Expand Down Expand Up @@ -491,6 +503,7 @@ jobs:
files: |
cluster-operator.yml
cluster-operator-quay-io.yml
cluster-operator-ghcr-io.yml
generate_release_notes: true
draft: true
body_path: release-header.md
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ $(YTT): | $(LOCAL_TESTBIN)
chmod +x $(YTT)

QUAY_IO_OPERATOR_IMAGE ?= quay.io/rabbitmqoperator/cluster-operator:latest
GHCR_IO_OPERATOR_IMAGE ?= ghcr.io/rabbitmq/cluster-operator:latest
# Builds a single-file installation manifest to deploy the Operator
generate-installation-manifest: | $(YTT)
mkdir -p releases
kustomize build config/installation/ > releases/cluster-operator.yml
$(YTT) -f releases/cluster-operator.yml -f config/ytt/overlay-manager-image.yaml --data-value operator_image=$(QUAY_IO_OPERATOR_IMAGE) > releases/cluster-operator-quay-io.yml
$(YTT) -f releases/cluster-operator.yml -f config/ytt/overlay-manager-image.yaml --data-value operator_image=$(GHCR_IO_OPERATOR_IMAGE) > releases/cluster-operator-ghcr-io.yml

docker-build: ## Build the docker image with tag `latest`
@$(call check_defined, OPERATOR_IMAGE, path to the Operator image within the registry e.g. rabbitmq/cluster-operator)
Expand Down
Loading