From eabe16aa33323553e7fa965488eedeeea6a9ffa7 Mon Sep 17 00:00:00 2001 From: bkochauri-memphis Date: Tue, 16 Dec 2025 00:09:25 +0400 Subject: [PATCH 1/7] add version --- .github/workflows/release.yaml | 105 +++++++++++++++++++++++++++------ 1 file changed, 87 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8acdfe5..a123238 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,32 +1,101 @@ -name: Trigger Jenkins Job +name: Maven Deploy and Release on: push: branches: + - github-action - latest paths: - superstream-clients/pom.xml jobs: - trigger-jenkins: - runs-on: self-hosted + deploy: + runs-on: ubuntu-latest + + env: + HOME: /home/runner steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Determine deployment type + id: deployment + run: | + # Automatic deployment based on branch + if [ "${{ github.ref }}" == "refs/heads/latest" ]; then + echo "type=production" >> $GITHUB_OUTPUT + echo "branch=latest" >> $GITHUB_OUTPUT + else + echo "type=beta" >> $GITHUB_OUTPUT + echo "branch=github-action" >> $GITHUB_OUTPUT + fi + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Trigger Jenkins Job + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Import GPG key env: - JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | - HTTP_STATUS=$(curl -w "%{http_code}" -o /tmp/jenkins_response.txt -f -X POST \ - "https://jenkins.superstream.ai/job/DevOps/job/Superstream/job/SDK/job/superstream-clients-java/buildWithParameters?DEPLOYMENT_TYPE=production" \ - --user "team@superstream.ai:$JENKINS_TOKEN") - - if [ $? -ne 0 ] || [ "$HTTP_STATUS" -ne 201 ] && [ "$HTTP_STATUS" -ne 200 ]; then - echo "Jenkins trigger failed with HTTP status: $HTTP_STATUS" - cat /tmp/jenkins_response.txt - exit 1 - fi - - echo "Successfully triggered Jenkins build (HTTP $HTTP_STATUS)" \ No newline at end of file + echo "$GPG_PRIVATE_KEY" | gpg --batch --yes --passphrase "$GPG_PASSPHRASE" --import + echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf + gpg --list-secret-keys --keyid-format LONG + echo "D64C041FB68170463BE78AD7C4E3F1A8A5F0A659:6:" | gpg --import-ownertrust + + - name: Read Version from pom.xml + id: version + working-directory: superstream-clients + run: | + POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "Original version from pom.xml: $POM_VERSION" + echo "base=$POM_VERSION" >> $GITHUB_OUTPUT + + - name: Create Maven Settings + run: | + mkdir -p ~/.m2 + echo "${{ secrets.MAVEN_SETTINGS }}" > ~/.m2/settings.xml + + - name: Build and Deploy Beta + if: steps.deployment.outputs.type == 'beta' + working-directory: superstream-clients + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + mvn -B package --file pom.xml + BETA_VERSION="${{ steps.version.outputs.base }}-beta" + echo "Setting beta version: $BETA_VERSION" + mvn versions:set -DnewVersion=$BETA_VERSION + mvn -s ~/.m2/settings.xml deploy -DautoPublish=true -Dgpg.passphrase="$GPG_PASSPHRASE" + + - name: Build and Deploy Production + if: steps.deployment.outputs.type == 'production' + working-directory: superstream-clients + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + mvn -B package --file pom.xml + mvn -s ~/.m2/settings.xml deploy -DautoPublish=true -Dgpg.passphrase="$GPG_PASSPHRASE" + + - name: Create GitHub Release + if: steps.deployment.outputs.type == 'production' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION="${{ steps.version.outputs.base }}" + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b $VERSION + git push origin $VERSION + cd superstream-clients + gh release create $VERSION target/superstream-clients-${VERSION}.jar --generate-notes + + + From 3ee561026fc815242e6f95aaaf9dd2e4a9cac0ae Mon Sep 17 00:00:00 2001 From: bkochauri-memphis Date: Tue, 16 Dec 2025 00:11:03 +0400 Subject: [PATCH 2/7] add version --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a123238..b1295e5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,9 +4,9 @@ on: push: branches: - github-action - - latest - paths: - - superstream-clients/pom.xml + # - latest + # paths: + # - superstream-clients/pom.xml jobs: deploy: From ca238f66fd90119a0e7b739055f2b779ca8f6af3 Mon Sep 17 00:00:00 2001 From: bkochauri-memphis Date: Tue, 16 Dec 2025 00:13:24 +0400 Subject: [PATCH 3/7] deplloy --- .github/workflows/release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b1295e5..2cbf87b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,9 +4,9 @@ on: push: branches: - github-action - # - latest - # paths: - # - superstream-clients/pom.xml + - latest + paths: + - superstream-clients/pom.xml jobs: deploy: @@ -25,7 +25,7 @@ jobs: echo "branch=latest" >> $GITHUB_OUTPUT else echo "type=beta" >> $GITHUB_OUTPUT - echo "branch=github-action" >> $GITHUB_OUTPUT + echo "branch=master" >> $GITHUB_OUTPUT fi - name: Checkout From 149ca07e20df0ce7abdb85435b2dca7213a1f26a Mon Sep 17 00:00:00 2001 From: bkochauri-memphis Date: Tue, 16 Dec 2025 09:25:50 +0400 Subject: [PATCH 4/7] fix typo --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2cbf87b..f1f55b5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: Maven Deploy and Release on: push: branches: - - github-action + - master - latest paths: - superstream-clients/pom.xml From 4f762cf2f3840bf8dc50597cfde49b66e19214ad Mon Sep 17 00:00:00 2001 From: bkochauri-memphis Date: Wed, 17 Dec 2025 12:04:17 +0400 Subject: [PATCH 5/7] replace new webhooks --- .github/workflows/release.yaml | 69 ++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f1f55b5..3267637 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,10 +3,10 @@ name: Maven Deploy and Release on: push: branches: - - master - - latest - paths: - - superstream-clients/pom.xml + - github-action + # - latest + # paths: + # - superstream-clients/pom.xml jobs: deploy: @@ -97,5 +97,66 @@ jobs: cd superstream-clients gh release create $VERSION target/superstream-clients-${VERSION}.jar --generate-notes + - name: Send Slack Notification - Success + if: success() && steps.deployment.outputs.type == 'production' + uses: slackapi/slack-github-action@v1 + with: + payload: | + { + "text": "✅ Production deployment succeeded for superstream-clients-java version ${{ steps.version.outputs.base }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "✅ *Production Deployment Succeeded*\n*Repository:* ${{ github.repository }}\n*Version:* ${{ steps.version.outputs.base }}\n*Branch:* ${{ steps.deployment.outputs.branch }}\n*Triggered by:* ${{ github.actor }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + - name: Send Slack Notification - Failure + if: failure() && steps.deployment.outputs.type == 'production' + uses: slackapi/slack-github-action@v1 + with: + payload: | + { + "text": "❌ Production deployment failed for superstream-clients-java", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "❌ *Production Deployment Failed*\n*Repository:* ${{ github.repository }}\n*Branch:* ${{ steps.deployment.outputs.branch }}\n*Triggered by:* ${{ github.actor }}\n*Workflow:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + + - name: Send Slack Notification - Cancelled + if: cancelled() && steps.deployment.outputs.type == 'production' + uses: slackapi/slack-github-action@v1 + with: + payload: | + { + "text": "⚠️ Production deployment was cancelled for superstream-clients-java", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "⚠️ *Production Deployment Cancelled*\n*Repository:* ${{ github.repository }}\n*Branch:* ${{ steps.deployment.outputs.branch }}\n*Triggered by:* ${{ github.actor }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK From ae5dd766d7ad9e83a595b81949e9f52d9999012f Mon Sep 17 00:00:00 2001 From: bkochauri-memphis Date: Wed, 17 Dec 2025 12:08:32 +0400 Subject: [PATCH 6/7] aline notification --- .github/workflows/release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3267637..7682ba1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,10 +3,10 @@ name: Maven Deploy and Release on: push: branches: - - github-action - # - latest - # paths: - # - superstream-clients/pom.xml + - master + - latest + paths: + - superstream-clients/pom.xml jobs: deploy: From cdff0c8666e48f9041a6fc33147b20e9054a0e82 Mon Sep 17 00:00:00 2001 From: bkochauri-memphis Date: Wed, 17 Dec 2025 12:56:19 +0400 Subject: [PATCH 7/7] add github versioning --- .github/workflows/release.yaml | 33 ++----------------- .../dependency-reduced-pom.xml | 2 +- superstream-clients/pom.xml | 2 +- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7682ba1..dc6daa4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -103,16 +103,7 @@ jobs: with: payload: | { - "text": "✅ Production deployment succeeded for superstream-clients-java version ${{ steps.version.outputs.base }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "✅ *Production Deployment Succeeded*\n*Repository:* ${{ github.repository }}\n*Version:* ${{ steps.version.outputs.base }}\n*Branch:* ${{ steps.deployment.outputs.branch }}\n*Triggered by:* ${{ github.actor }}" - } - } - ] + "text": "superstream-clients-java v${{ steps.version.outputs.base }} Production Release SUCCESSFUL" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} @@ -124,16 +115,7 @@ jobs: with: payload: | { - "text": "❌ Production deployment failed for superstream-clients-java", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "❌ *Production Deployment Failed*\n*Repository:* ${{ github.repository }}\n*Branch:* ${{ steps.deployment.outputs.branch }}\n*Triggered by:* ${{ github.actor }}\n*Workflow:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } - } - ] + "text": "superstream-clients-java v${{ steps.version.outputs.base }} Production Release FAILED" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} @@ -145,16 +127,7 @@ jobs: with: payload: | { - "text": "⚠️ Production deployment was cancelled for superstream-clients-java", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "⚠️ *Production Deployment Cancelled*\n*Repository:* ${{ github.repository }}\n*Branch:* ${{ steps.deployment.outputs.branch }}\n*Triggered by:* ${{ github.actor }}" - } - } - ] + "text": "superstream-clients-java v${{ steps.version.outputs.base }} Production Release CANCELLED" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/superstream-clients/dependency-reduced-pom.xml b/superstream-clients/dependency-reduced-pom.xml index b2e1966..4314969 100644 --- a/superstream-clients/dependency-reduced-pom.xml +++ b/superstream-clients/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ ai.superstream superstream-clients Superstream Kafka Client Optimizer - 2.0.1 + 2.0.2 A Java library that dynamically optimizes Kafka client configuration based on recommendations https://github.com/superstreamlabs/superstream-clients-java diff --git a/superstream-clients/pom.xml b/superstream-clients/pom.xml index f40d974..04e64c8 100644 --- a/superstream-clients/pom.xml +++ b/superstream-clients/pom.xml @@ -6,7 +6,7 @@ ai.superstream superstream-clients - 2.0.1 + 2.0.2 jar Superstream Kafka Client Optimizer