Skip to content
Merged
Changes from all commits
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
84 changes: 84 additions & 0 deletions .github/workflows/docker-strimzi-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Docker Strimzi Release

on:
workflow_dispatch:
inputs:
tag:
description: 'AutoMQ Version Tag'
required: false
type: string
workflow_run:
workflows: ["GitHub Release"]
types:
- completed

env:
KAFKA_VERSION: "3.9.0"
STRIMZI_REPO: "https://github.com/AutoMQ/strimzi-kafka-operator.git"
STRIMZI_BRANCH: "main"

jobs:
strimzi-release:
name: Strimzi Image Release
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
platform: [ "ubuntu-24.04" ]
jdk: ["17"]
runs-on: ${{ matrix.platform }}
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get release tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ github.event.inputs.tag }}" ]]; then
TAG="${{ github.event.inputs.tag }}"
# use the latest tag if not specified
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAG=$(git ls-remote --tags https://github.com/AutoMQ/automq.git | grep -v '\^{}' | tail -1 | sed 's/.*refs\/tags\///')
else
TAG="${{ github.event.workflow_run.head_branch }}"
fi

AUTOMQ_URL="https://github.com/AutoMQ/automq/releases/download/${TAG}/automq-${TAG}_kafka-${KAFKA_VERSION}.tgz"

{
echo "AUTOMQ_VERSION=${TAG}"
echo "AUTOMQ_URL=${AUTOMQ_URL}"
} >> $GITHUB_ENV

- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: "zulu"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_READ_WRITE_TOKEN }}

- name: Build AutoMQ Strimzi Image
run: |
git clone --depth 1 --branch "${{ env.STRIMZI_BRANCH }}" "${{ env.STRIMZI_REPO }}" strimzi
cd strimzi

chmod +x ./tools/automq/build-automq-image.sh
./tools/automq/build-automq-image.sh \
"${{ env.AUTOMQ_VERSION }}" \
"${{ env.AUTOMQ_URL }}" \
"${{ env.KAFKA_VERSION }}" \
"${{ secrets.DOCKERHUB_USERNAME }}" \
"automq"
Loading