-
Notifications
You must be signed in to change notification settings - Fork 6
Migrate to Vanniktech's Gradle Maven Publish Plugin #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As it supports Maven Central publication. OSSRH is reaching end of life on June 30, 2025.
Instead of "functional tests"
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
=======================================
Coverage 71.32% 71.32%
=======================================
Files 22 22
Lines 415 415
Branches 50 50
=======================================
Hits 296 296
Misses 105 105
Partials 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
As build no longer uses it to test the artifacts publishing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the project’s Maven publication setup to use Vanniktech’s Gradle Maven Publish Plugin, removes the custom publication.gradle script, and updates CI workflows to drive publication via the new plugin.
- Adds and applies
com.vanniktech.maven.publishinsettings.gradleand theparselymodule. - Deletes legacy Maven-Publish + Signing script (
publication.gradle). - Updates GitHub Actions workflows to use
publishToMavenCentraland new setup actions.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle | Added Vanniktech Maven Publish plugin to pluginManagement block. |
| publication.gradle | Removed entire custom maven-publish + signing configuration. |
| parsely/build.gradle | Applied Vanniktech plugin, defined version logic, and configured publishing DSL. |
| .github/workflows/submit-gradle-dependencies.yml | Replaced two-step Graph action with gradle/actions/dependency-submission@v4. |
| .github/workflows/readme.yml | Switched to setup-gradle@v4, updated snapshot publish step and env props. |
| .github/workflows/publish.yml | Switched to setup-gradle@v4, updated publish command and env props. |
| return 'git describe --abbrev=0 --tags'.execute().text.trim() | ||
| } | ||
|
|
||
| def isTagBuild = System.getenv("GITHUB_REF_TYPE") == 'tag' |
Copilot
AI
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GITHUB_REF_TYPE is not a standard CI environment variable in GitHub Actions, so isTagBuild will always be false. Consider passing a custom env var from your workflow (e.g. ref_type: ${{ github.ref_type }}) or parse GITHUB_REF to detect refs/tags/.
| def isTagBuild = System.getenv("GITHUB_REF_TYPE") == 'tag' | |
| def isTagBuild = System.getenv("GITHUB_REF")?.startsWith("refs/tags/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| apply from: "${rootProject.projectDir}/publication.gradle" | ||
| def static getVersionFromGitTag() { |
Copilot
AI
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invoking shell commands via String.execute() lacks error handling and may not work on all platforms. Consider using Gradle's project.exec {} or a dedicated Git plugin (e.g., org.ajoberstar.grgit) for more robust tag retrieval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, it's also not CC compatible, but this git operation is so straightforward and plain, that I don't think we need to use a service to run it. It worked without any issues so far.
|
FYI: Unrelated, but if we have access to this repo @wzieba (I don't), let's auto-link AINFRA tickets via |
ParaskP7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @wzieba and thanks for dealing with the migration! 🚀 x 🥇 ^ 🙇
As it supports Maven Central publication. OSSRH is reaching end of life on June 30, 2025.
Can you think of any other such sdk/library we support that might be having the same need for such a migration. I can't think any... 🤞
I've decided to use Vanniktech's Gradle Maven Publish Plugin as it's one of the suggested in Gradle Cookbook and it's already used at A8c in Gravatar: Automattic/Gravatar-SDK-Android#590
💯
You can check snapshots created by this PR
I can't find the artifacts, getting a 404, can you help? 🙏 PS: I am logged-in. 👍
If you wish, you can rerun build GitHub Action job and see a new snapshot artifact is present. This proves, that the Maven Central configuration should be correct (credentials + gpg keys).
👍 + 🤞
We'll be able to test if release actually works, with the next stable release.
🤞
| java-version: '17' | ||
| distribution: 'temurin' | ||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 PS: Which makes me wonder how come this wasn't there in the first place... 😊
| SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
| SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | ||
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | ||
| - name: Publish build artifacts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question (❓): Is that really not needed anymore, similar to us publishing build artifacts on functional-tests. PS: Which makes me wonder again, why was it needed before. 🤔
| - name: Generate the dependency graph which will be submitted post-job | ||
| run: ./gradlew :parsely:dependencies | ||
| - name: Generate and submit dependency graph | ||
| uses: gradle/actions/dependency-submission@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise (❤️): Nice change, less configuration with dependency-submission, plus TIL! 🥇
| return 'git describe --abbrev=0 --tags'.execute().text.trim() | ||
| } | ||
|
|
||
| def isTagBuild = System.getenv("GITHUB_REF_TYPE") == 'tag' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise (❤️): Nice addition of the tag/SNAPSHOT logic. 👍
|
Btw @wzieba, just for my FYI, did you follow any/all these 0.33.0 caution steps: |
|
Also, unrelated, but just because I haven't worked on this library for so long, I tried running the UI tests ( Wanted to share, just in case! 😊 |
Me too, it seems there's an issue with Sonatype: if you snapshot repository and click on
yes
Just to be on the same page, it's not a UI test - this SDK doesn't provide UI. These tests are also executed on CI. From the stacktrace you shared, I see you have a conflict of orchestrator: either disable orchestrator and run tests or uninstall the orchestrator already installed on the test device 👍 |
🤷
Thanks for clarifying that for me! 🙏
Ah, yea, I meant connected (functional) tests...
Yes. 👍
👍 |
|
Thanks for the review @ParaskP7 ! I'll merge this as I see it's not the first time snapshot repository is broken. If anything, we'll adjust this configuration with the nearest release. |
I agree, thanks @wzieba ! 🚀 |



Closes: AINFRA-522
As it supports Maven Central publication. OSSRH is reaching end of life on June 30, 2025.
I've decided to use Vanniktech's Gradle Maven Publish Plugin as it's one of the suggested in Gradle Cookbook and it's already used at A8c in Gravatar: Automattic/Gravatar-SDK-Android#590
How to test
You can check snapshots created by this PR
Logs: https://github.com/Parsely/parsely-android/actions/runs/15971368189/job/45043122854?pr=122
Artifacts: https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/parsely/parsely/4.1.1-SNAPSHOT/
If you wish, you can rerun
buildGitHub Action job and see a new snapshot artifact is present. This proves, that the Maven Central configuration should be correct (credentials + gpg keys). We'll be able to test if release actually works, with the next stable release.