You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by pi...@apache.org on 2025/06/19 19:09:23 UTC

(iggy) branch master updated: chore(ci): publish java-sdk SNAPSHOTs to maven (#1883)

This is an automated email from the ASF dual-hosted git repository.

piotr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new 559e4d66 chore(ci): publish java-sdk SNAPSHOTs to maven (#1883)
559e4d66 is described below

commit 559e4d66d37dd1bdde57d548c07ed2203cc011d0
Author: Nandakumar Vadivelu <na...@apache.org>
AuthorDate: Fri Jun 20 00:39:19 2025 +0530

    chore(ci): publish java-sdk SNAPSHOTs to maven (#1883)
    
    Fixes #1882
---
 .github/workflows/publish_java_sdk_snapshots.yml | 61 ++++++++++++++++++++++++
 foreign/java/java-sdk/build.gradle.kts           |  1 -
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/publish_java_sdk_snapshots.yml b/.github/workflows/publish_java_sdk_snapshots.yml
new file mode 100644
index 00000000..eb66ec7c
--- /dev/null
+++ b/.github/workflows/publish_java_sdk_snapshots.yml
@@ -0,0 +1,61 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: publish java-sdk SNAPSHOTs
+
+on:
+  schedule:
+    - cron: "5 0 * * *"
+
+jobs:
+  publish:
+    if: github.repository == 'apache/iggy'
+    name: Publish Snapshots
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Code
+        uses: actions/checkout@v4
+
+      - name: Setup Java
+        uses: actions/setup-java@v4
+        with:
+          java-version: "17"
+          distribution: "temurin"
+
+      - name: Setup Gradle
+        uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
+
+      - name: Build
+        run: foreign/java/dev-support/checks/build.sh build -x test -x checkstyleMain -x checkstyleTest
+
+      - name: Run tests
+        run: foreign/java/dev-support/checks/build.sh test
+
+      - id: extract_version
+        name: Extract version
+        shell: bash
+        if: ${{ success() }}
+        run: |
+          VERSION=$(foreign/java/gradlew -p foreign/java/java-sdk properties -q | grep "version:")
+          if [[ "$VERSION" == *"SNAPSHOT"* ]]; then
+              echo "snapshot=SNAPSHOT" >> $GITHUB_OUTPUT
+          fi
+
+      - name: Publish Snapshot
+        if: steps.extract_version.outputs.snapshot == 'SNAPSHOT'
+        # To publish we use secrets.NEXUS_USER and secrets.NEXUS_PASSWORD as credentials
+        run: foreign/java/dev-support/checks/build.sh build -x test -x checkstyleMain -x checkstyleTest publish
diff --git a/foreign/java/java-sdk/build.gradle.kts b/foreign/java/java-sdk/build.gradle.kts
index ff673835..f9a6e578 100644
--- a/foreign/java/java-sdk/build.gradle.kts
+++ b/foreign/java/java-sdk/build.gradle.kts
@@ -108,7 +108,6 @@ publishing {
             url = uri(if ((version as String).endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
 
             credentials {
-                // Assumes 'apacheUserName' and 'apachePassWord' are available as properties
                 username = System.getenv("secrets.NEXUS_USER")
                 password = System.getenv("secrets.NEXUS_PASSWORD")
             }