feat(version): bump version to 1.2.0-rc1 (#2025) #67
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Release | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | |
jobs: | |
docker-release: | |
name: Docker Image Release | |
strategy: | |
matrix: | |
platform: [ "ubuntu-22.04" ] | |
jdk: ["17"] | |
runs-on: ${{ matrix.platform }} | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK ${{ matrix.jdk }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.jdk }} | |
distribution: "zulu" | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Get project version | |
id: get_project_version | |
run: | | |
project_version=$(./gradlew properties | grep "version:" | awk '{print $2}') | |
echo "PROJECT_VERSION=${project_version}" >> $GITHUB_OUTPUT | |
- name: Build TarGz | |
run: | | |
./gradlew -Pprefix=automq-${{ github.ref_name }}_ --build-cache --refresh-dependencies clean releaseTarGz | |
# docker image release | |
- name: Cp TarGz to Docker Path | |
run: | | |
cp ./core/build/distributions/automq-${{ github.ref_name }}_kafka-${{ steps.get_project_version.outputs.PROJECT_VERSION }}.tgz ./docker/ | |
- name: Determine Image Tags | |
id: image_tags | |
run: | | |
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) | |
echo "LATEST_TAG=${LATEST_TAG}" | |
if [ "$LATEST_TAG" == "${{ github.ref_name }}" ]; then | |
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/automq:${{ github.ref_name }}, ${{ secrets.DOCKERHUB_USERNAME }}/automq:latest" >> $GITHUB_OUTPUT | |
else | |
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/automq:${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
fi | |
- 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 and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./docker | |
push: true | |
tags: ${{ steps.image_tags.outputs.tags }} | |
platforms: linux/amd64,linux/arm64 |