Skip to content

Migrate to vanniktech maven publish#2300

Merged
priettt merged 1 commit intomainfrom
priettt/migratePublishingPlugin
Jul 2, 2025
Merged

Migrate to vanniktech maven publish#2300
priettt merged 1 commit intomainfrom
priettt/migratePublishingPlugin

Conversation

@priettt
Copy link
Copy Markdown
Contributor

@priettt priettt commented Jul 1, 2025

Goal

Use https://github.com/vanniktech/gradle-maven-publish-plugin for publishing to Maven Central. We were using a temporal workaround, and this plugin seems better maintained and widely used in many other projects.

Changes:

  • Add and use vanniktech.maven.publish.
  • Add ORG_GRADLE_PROJECT_ prefix to environment variables in workflows, as the plugin looks for those variables automatically.
  • Add publish-snapshot.yml. It will publish a snapshot daily, or on trigger.
  • Remove release-workflow.yml, as we now only upload artifacts to maven central, and then we publish manually.
  • Updated and renamed upload-artifacts-to-sonatype.yml, we now use it to publish artifacts.
  • Remove uses of nexus-publish, maven-publish, and signing plugins, as they're replaced by vanniktech.
  • Remove Embrace QA and Beta repos, they aren't used anymore.
  • Remove java { withJavadoc... } blocks, as vanniktech adds them automatically.
  • Remove gradle plugin marker creation, as vanniktech does that automatically.
  • Remove signing blocks, as vanniktech reads the ORG_GRADLE_PROJECT_ env vars in our workflows, and signs releases automatically.
  • Will update our internal release docs to reflect how we can test manually.

I released two test versions, one without changes, one with the vanniktech plugin. They both look the same, same artifacts are uploaded, and they both work when tested manually.

@priettt priettt requested a review from a team as a code owner July 1, 2025 19:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 1, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/embrace-io/public-actions/upload-sdk-version 88167cd1a3fce3418e26c8c842026e6dfab99e41 UnknownUnknown
actions/actions/setup-java 4.*.* 🟢 5.6
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 34 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
Vulnerabilities🟢 82 existing vulnerabilities detected
actions/gradle/actions/setup-gradle ac638b010cf58a27ee6c972d7336334ccaf61c96 🟢 7.7
Details
CheckScoreReason
Code-Review⚠️ 0Found 1/14 approved changesets -- score normalized to 0
Maintained🟢 1030 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10
Dependency-Update-Tool🟢 10update tool detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies🟢 10all dependencies are pinned
SAST🟢 9SAST tool detected but not run on all commits
Signed-Releases⚠️ -1no releases found
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Binary-Artifacts🟢 10no binaries found in the repo
Security-Policy🟢 10security policy file detected
Vulnerabilities🟢 91 existing vulnerabilities detected
CI-Tests🟢 1010 out of 10 merged PRs checked by a CI test -- score normalized to 10
Contributors🟢 10project has 7 contributing companies or organizations
actions/actions/checkout 4.*.* 🟢 5.2
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Maintained⚠️ 01 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ -1internal error: error during GetBranch(releases/v2): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration
SAST🟢 9SAST tool detected but not run on all commits
Vulnerabilities⚠️ 010 existing vulnerabilities detected
actions/actions/setup-java 4.*.* 🟢 5.6
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 34 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
Vulnerabilities🟢 82 existing vulnerabilities detected
actions/gradle/actions/setup-gradle ac638b010cf58a27ee6c972d7336334ccaf61c96 🟢 7.7
Details
CheckScoreReason
Code-Review⚠️ 0Found 1/14 approved changesets -- score normalized to 0
Maintained🟢 1030 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10
Dependency-Update-Tool🟢 10update tool detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies🟢 10all dependencies are pinned
SAST🟢 9SAST tool detected but not run on all commits
Signed-Releases⚠️ -1no releases found
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Binary-Artifacts🟢 10no binaries found in the repo
Security-Policy🟢 10security policy file detected
Vulnerabilities🟢 91 existing vulnerabilities detected
CI-Tests🟢 1010 out of 10 merged PRs checked by a CI test -- score normalized to 10
Contributors🟢 10project has 7 contributing companies or organizations

Scanned Files

  • .github/workflows/publish-api-docs.yml
  • .github/workflows/publish-snapshot.yml
  • .github/workflows/release-workflow.yml
  • .github/workflows/upload-artifacts-to-maven-central.yml
  • .github/workflows/upload-artifacts-to-sonatype.yml

@priettt priettt changed the title Migrate to vanniktech maven publish [WIP] Migrate to vanniktech maven publish Jul 1, 2025
@priettt priettt force-pushed the priettt/migratePublishingPlugin branch from e85c1aa to cf0b6ad Compare July 1, 2025 19:55
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.19%. Comparing base (9f8c1de) to head (ab1aac5).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2300      +/-   ##
==========================================
- Coverage   85.20%   85.19%   -0.01%     
==========================================
  Files         476      476              
  Lines       10547    10547              
  Branches     1550     1550              
==========================================
- Hits         8987     8986       -1     
+ Misses        891      890       -1     
- Partials      669      671       +2     

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@priettt priettt force-pushed the priettt/migratePublishingPlugin branch 5 times, most recently from e49b70a to 75a90e6 Compare July 2, 2025 15:12
@priettt priettt changed the title [WIP] Migrate to vanniktech maven publish Migrate to vanniktech maven publish Jul 2, 2025
@priettt priettt force-pushed the priettt/migratePublishingPlugin branch 2 times, most recently from 8f6aa96 to b5d6f01 Compare July 2, 2025 17:25
timeout-minutes: 60
steps:
- name: Validate access to version data service
uses: embrace-io/public-actions/upload-sdk-version@88167cd1a3fce3418e26c8c842026e6dfab99e41
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok to pin things to this SHA?

Copy link
Copy Markdown
Contributor Author

@priettt priettt Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how it's done everywhere, at least for this particular action. I'm not a fan, but I think it's the only way to make an action immutable. @fnewberg might have additional reasons

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like "current version" should be defined as a variable and be referenced everywhere so we don't have to make N changes when the version revs. Not a blocker - just something to consider.


on:
schedule:
- cron: '0 16 * * *' # Runs every day at 16:00 UTC
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the middle of a work day. Why not 5 UTC or something to ensure it's done when Jamie gets online?

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way we can apply the same Java config to all of our builds, production, snapshot, and otherwise?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use a shared workflow, though I'm not sure if it'd work

Copy link
Copy Markdown
Contributor

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some comments about logic consolidation and snapshot timing but not blocking

@priettt priettt force-pushed the priettt/migratePublishingPlugin branch from b5d6f01 to ab1aac5 Compare July 2, 2025 18:35
@priettt priettt merged commit 5fc4a26 into main Jul 2, 2025
13 checks passed
@priettt priettt deleted the priettt/migratePublishingPlugin branch July 2, 2025 19:06
priettt added a commit that referenced this pull request Jul 17, 2025
priettt added a commit that referenced this pull request Jul 17, 2025
* Migrate to vanniktech maven publish (#2300)

* Update publish-api-docs.yml to handle hotfixes

* Update upload-artifacts-to-maven-central.yml to accept hotfixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants