build: add Maven Central publishing configuration#2
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughA new GitHub Actions workflow for publishing artifacts to Maven Central was added, enabling manual publishing with secure credential handling. The Android library's build script was updated to use the Vanniktech Maven Publish plugin, standardizing the publishing process, updating the namespace, and providing detailed Maven metadata. Changes
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
tpstreams-android-player/build.gradle.kts (1)
58-73: 🛠️ Refactor suggestionRemove legacy
afterEvaluatepublication block
The oldafterEvaluate { publishing { ... } }block duplicates and may conflict with the newmavenPublishingconfiguration. Removing it prevents accidental double publications:- afterEvaluate { - publishing { - publications { - create<MavenPublication>("release") { - groupId = "com.tpstreams" - artifactId = "tpstreams-player" - version = "1.0.1" - - from(components["release"]) - } - } - repositories { - mavenLocal() - } - } - }
🧹 Nitpick comments (7)
.github/workflows/publish.yml (3)
2-4: Consider expanding trigger events for automated releases
Currently, the workflow runs only on manualworkflow_dispatch. If you’d like to automatically publish on new version tags (e.g.,v1.2.3) or merges tomain, consider addingpush(withtags:orbranches:) triggers.
9-11: Ensure full Git history for tag-based versioning
For reproducible Maven Central releases (especially if you switch to tag triggers), you’ll need commit history and tags. Addfetch-depth: 0to theactions/checkoutstep:- uses: actions/checkout@v4 + uses: actions/checkout@v4 + with: + fetch-depth: 0
16-17: Cache Gradle artifacts to speed up builds
Consider adding a caching step for Gradle to reduce build times on repeat runs. For example:- name: Cache Gradle packages uses: actions/cache@v3 with: path: | ~/.gradle/caches ~/.gradle/wrapper/ key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle-tpstreams-android-player/build.gradle.kts (4)
1-3: Remove unused import
AndroidSingleVariantLibraryis imported but never used. Removing unused imports keeps the build script clean and avoids warnings.
7-10: Simplify plugin declarations
Thecom.vanniktech.maven.publishplugin already appliesmaven-publish. You can remove the explicitid("maven-publish")to declutter the plugin block:- id("maven-publish")
89-95: Use secure license URL
Maven Central prefershttpsURLs. Change the license URL to:- url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
84-88: Consider adding a<developers>section to the POM
Maven Central requires at least one developer entry. You can enhance your POM as follows:pom { developers { developer { id.set("syed-tp") name.set("Syed TP") url.set("https://github.com/syed-tp") } } // existing entries... }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/publish.yml(1 hunks)tpstreams-android-player/build.gradle.kts(2 hunks)
🔇 Additional comments (1)
.github/workflows/publish.yml (1)
18-25: Validate secret names and scopes in CI settings
The environment variables for Maven Central credentials and GPG signing rely on GitHub Secrets (MAVEN_CENTRAL_USERNAME, etc.). Ensure these secrets exist in the repo or organization settings and are scoped appropriately (e.g., protected onmain).
Summary by CodeRabbit