From 124d6c8f3bd21677f293e61c6aa50473ac564a2e Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 10 Jul 2025 11:28:14 +0000 Subject: [PATCH 1/5] Attempt to update to maven central --- .github/workflows/release.yml | 12 ++++------- pom.xml | 38 +++++------------------------------ 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7d9618d7..0e62c8255 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,19 +17,15 @@ jobs: uses: actions/setup-java@v3 with: java-version: 8 - server-id: ossrh + server-id: central distribution: "adopt" - server-username: OSSRH_USERNAME - server-password: OSSRH_PASSWORD + server-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + server-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg-passphrase: GPG_PASSPHRASE + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Publish to the Maven Central Repository run: mvn -Prelease -DskipTests=true --batch-mode deploy - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - name: Create GitHub release uses: softprops/action-gh-release@v1 diff --git a/pom.xml b/pom.xml index 8338221d5..9172ac987 100644 --- a/pom.xml +++ b/pom.xml @@ -48,12 +48,6 @@ GitHub Actions https://github.com/databricks/databricks-sdk-java/blob/main/.github/workflows/push.yml - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - 0.8.10 UTF-8 @@ -263,35 +257,13 @@ - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - - --pinentry-mode - loopback - - - - - sign-artifacts - - sign - - verify - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 true - ossrh - https://oss.sonatype.org/ - true + central + true From d663e285709a2060eaa7c86f7732f128b440da62 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 10 Jul 2025 11:32:11 +0000 Subject: [PATCH 2/5] Make the flow manually triggerable --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e62c8255..aa6a4cf58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,6 @@ name: Release on: + workflow_dispatch: push: tags: - "v*" From c0e52d8df6ffb1e9a9b84409a6d8b94a318c2d40 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 10 Jul 2025 11:33:56 +0000 Subject: [PATCH 3/5] Fix typo --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9172ac987..56aedf430 100644 --- a/pom.xml +++ b/pom.xml @@ -259,7 +259,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.5.0 + 0.5.0 true central From 2398fb15145965d33f3b301a8eeab0c3b84708f3 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 10 Jul 2025 11:39:14 +0000 Subject: [PATCH 4/5] Dry run for debugging --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa6a4cf58..3bd5e105b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,10 @@ on: push: tags: - "v*" + push: + branches: + - "renaud-hartert_data/maven-migration" + jobs: publish: runs-on: @@ -26,7 +30,7 @@ jobs: gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Publish to the Maven Central Repository - run: mvn -Prelease -DskipTests=true --batch-mode deploy + run: mvn -Prelease -DskipTests=true --batch-mode verify - name: Create GitHub release uses: softprops/action-gh-release@v1 From 6b7c19e312f762c8fa9ebe9f8ec50de50145f17d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 10 Jul 2025 11:46:59 +0000 Subject: [PATCH 5/5] Testing --- .github/workflows/release.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3bd5e105b..d8fd47152 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,19 @@ name: Release + on: - workflow_dispatch: push: + # Run a real release on pushes to tags like v1.0, v2.3.4, etc. tags: - "v*" - push: + # Run a dry-run on pushes to any branch branches: - - "renaud-hartert_data/maven-migration" + - "**" jobs: publish: + # Dynamically set the job name based on the trigger + name: ${{ startsWith(github.ref, 'refs/tags/') && 'Publish Release' || 'Run Release Dry-Run' }} + runs-on: group: databricks-deco-testing-runner-group labels: ubuntu-latest-deco @@ -29,10 +33,19 @@ jobs: gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} - - name: Publish to the Maven Central Repository + # This step runs ONLY on branch pushes (dry-run) + - name: Run Release Dry-Run (Verify) + if: "!startsWith(github.ref, 'refs/tags/')" run: mvn -Prelease -DskipTests=true --batch-mode verify + # This step runs ONLY on tag pushes (real release) + - name: Publish to Maven Central Repository (Deploy) + if: "startsWith(github.ref, 'refs/tags/')" + run: mvn -Prelease -DskipTests=true --batch-mode deploy + + # This step also runs ONLY on tag pushes (real release) - name: Create GitHub release + if: "startsWith(github.ref, 'refs/tags/')" uses: softprops/action-gh-release@v1 with: - files: target/*.jar + files: target/*.jar \ No newline at end of file