Deploy Release #14
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: Deploy Release | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'The branch from which to deploy the release' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
token: ${{ secrets.RELEASE_TOKEN }} | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: maven | |
server-id: ossrh | |
server-username: OSSRH_USERNAME # env variable for username in deploy | |
server-password: OSSRH_TOKEN # env variable for token in deploy | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
overwrite-settings: false | |
- name: Set Release Version | |
run: | | |
RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
KAFKA_VERSION=$(mvn help:evaluate -Dexpression=kafka.version -q -DforceStdout) | |
echo "BUILD_IMAGE_TAG=${RELEASE_VERSION}-kafka-${KAFKA_VERSION}" >> $GITHUB_ENV | |
echo "LATEST_IMAGE_TAG=latest-kafka-${KAFKA_VERSION}" >> $GITHUB_ENV | |
- name: Build with Maven | |
run: | | |
mvn -s .github/ci-maven-settings.xml -B \ | |
clean package -Dnative \ | |
-Dquarkus.native.container-build=true \ | |
-Dquarkus.container-image.build=true \ | |
-Dquarkus.container-image.tag=${{ env.BUILD_IMAGE_TAG }} \ | |
-Dquarkus.container-image.additional-tags=latest,${{ env.LATEST_IMAGE_TAG }} | |
- name: Integration Tests with Maven | |
run: | | |
mvn -s .github/ci-maven-settings.xml -B \ | |
clean verify -Dtest-container \ | |
-Dkafka-native-container-version=${{ env.BUILD_IMAGE_TAG }} \ | |
-Dzookeeper-native-container-version=${{ env.BUILD_IMAGE_TAG }} | |
- name: Release to Maven Central | |
run: | | |
mvn -s .github/ci-maven-settings.xml -B \ | |
clean deploy -DskipTests -Prelease | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Push To quay.io kafka-native | |
id: push-to-quay-kafka | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
tags: quay.io/ogunalp/kafka-native:latest quay.io/ogunalp/kafka-native:${{ env.BUILD_IMAGE_TAG }} quay.io/ogunalp/kafka-native:${{ env.LATEST_IMAGE_TAG }} | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Push To quay.io zookeeper-native | |
id: push-to-quay-zookeeper | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
tags: quay.io/ogunalp/zookeeper-native:latest quay.io/ogunalp/zookeeper-native:${{ env.BUILD_IMAGE_TAG }} quay.io/ogunalp/zookeeper-native:${{ env.LATEST_IMAGE_TAG }} | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} |