Skip to content

Automate release publishing via GitHub Actions#493

Merged
runningcode merged 12 commits intomasterfrom
no/automate-release-workflow
Mar 14, 2026
Merged

Automate release publishing via GitHub Actions#493
runningcode merged 12 commits intomasterfrom
no/automate-release-workflow

Conversation

@runningcode
Copy link
Owner

Summary

  • Add gradle-release.yml workflow triggered on tag push (v*) that publishes to Maven Central, Gradle Plugin Portal, and creates a GitHub Release with auto-generated notes
  • Simplify CI snapshot publishing from 2 steps with 3 separate publish tasks to a single publishToMavenCentral task
  • Switch secret passing from -P CLI flags to ORG_GRADLE_PROJECT_* env vars
  • Update docs/releasing.md to reflect the new automated flow

Required secrets

These need to be added to the repo settings (if not already present):

  • GPG_SIGNING_KEY — ASCII-armored GPG private key
  • GPG_SIGNING_KEY_ID — last 8 chars of key ID
  • GPG_SIGNING_KEY_PASSWORD — key passphrase
  • GRADLE_PUBLISH_KEY — Gradle Plugin Portal API key
  • GRADLE_PUBLISH_SECRET — Gradle Plugin Portal API secret

🤖 Generated with Claude Code

inktomi and others added 12 commits March 4, 2026 12:35
- Migrate from legacy variant API (AppExtension, TestedExtension, BaseVariant)
  to new variant API (ApplicationExtension, ApplicationAndroidComponentsExtension, Variant)
- Replace testVariants.configureEach with onVariants callbacks for APK path detection
- Add VariantApkInfo data class to capture variant info during configuration
- Update Gradle wrapper from 8.14.3 to 9.1.0 (minimum required by AGP 9.0)
- Update Kotlin language/API version from 1.7 to 2.0
- Remove kotlin-android plugin from sample projects (built-in in AGP 9.0)
- Add <T : Any> type bounds for Kotlin 2.0 compatibility
- Change task classes from open to abstract (AGP 9 requirement)
- Update minimum Gradle version from 7.3 to 9.1

Fixes #478
Add a release workflow triggered on tag push that publishes to Maven
Central, Gradle Plugin Portal, and creates a GitHub Release. Simplify
CI snapshot publishing to use a single vanniktech publishToMavenCentral
task and pass secrets via env vars instead of -P flags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@YotamNordman
Copy link

Code Review

Summary: Automates release publishing via GitHub Actions. New gradle-release.yml workflow triggered on tag push (v*) publishes to Maven Central, Gradle Plugin Portal, and creates GitHub Release with auto-generated notes. Consolidates 2 separate gradle publish tasks into 1. Switches from -P CLI flags to ORG_GRADLE_PROJECT_* env vars for secrets.

✅ Strengths

  1. Smart release automation:

    • New workflow triggered on push with tag v* pattern
    • Single workflow handles: Maven Central, Gradle Plugin Portal, GitHub Release
    • Eliminates manual release steps (operator error risk removed)
    • Clear trigger: tag push → automated releases
  2. Proper secret handling:

    • Switches from -P CLI flags (visible in logs) to ORG_GRADLE_PROJECT_* env vars
    • Gradle natively reads env vars; secrets masked in logs
    • Required secrets clearly documented in PR body
    • GPG signing, Sonatype username/password, Gradle Portal keys all listed
  3. Simplified CI snapshot publishing:

    • Old: 2 separate gradle commands with individual flag syntax
    • New: Single publishToMavenCentral command
    • Reduced complexity, fewer failure points
    • Added --no-configuration-cache for correctness
  4. GitHub Release automation:

    • Uses gh release create with --generate-notes
    • Auto-generates notes from commit history
    • No manual release notes needed
    • Proper permissions: contents: write for release creation
  5. Documentation updates:

    • docs/releasing.md updated to reflect new workflow
    • Removed manual publish steps (now automated)
    • Maven Central URL link fixed (oss.sonatype → central.sonatype)
    • Clear statement: "Pushing tag triggers release workflow"

⚠️ Issues & Concerns

  1. Mergeable state: unstable:

    • CI or status checks not passing
    • Blocks merge until resolved
  2. Missing workflow_dispatch security:

    • Workflow has workflow_dispatch trigger (can be run manually)
    • No job-level approval/restrictions
    • Anyone with repo access can manually trigger release via web UI
    • Should add environment or require approval for manual triggers
  3. No changelog file in release automation:

    • Generates release notes from commits (good!)
    • But changelog.md has duplicate "0.20.0" entry (error?)
    • Manual steps still say "Release to Maven Central → Click Publish" — is this still needed?
    • Unclear if Maven Central requires manual approval step or if workflow auto-promotes
  4. Version bumping not automated:

    • PR bumps version 0.19.1-SNAPSHOT → 0.20.0
    • Next version still manual (mkdocs.yml updated to 0.20.1)
    • Should either: fully automate version bumping or clearly document manual step
    • Risk: human might forget to update version, causing duplicate releases
  5. Gradle Plugin Portal key handling:

    • Uses GRADLE_PUBLISH_KEY/GRADLE_PUBLISH_SECRET as env vars
    • But these are custom names (not ORG_GRADLE_PROJECT_* pattern)
    • Gradle reads these natively, but inconsistent with other secret handling
    • Should document where these env var names come from (Gradle plugin spec?)
  6. Incomplete secret setup:

    • PR lists required secrets but doesn't show how to add them
    • No instructions for: GPG key export format, Gradle Portal API key generation
    • Operator needs to know: GPG_SIGNING_KEY must be ASCII-armored
    • Consider: link to Gradle docs or Sonatype docs for setup steps

🔍 Minor Issues

  • Changelog duplicate: "0.20.0" appears twice with identical text (should have unique changes)
  • --no-configuration-cache added to snapshot publish but rationale not documented (is it needed?)
  • 12 commits for relatively small change (suggests iteration; consider squashing in future)
  • Workflow uses gradle/actions/setup-gradle@v5 — should verify this is latest/stable

Verdict

⏸️ BLOCKED | Score: 7/10

Blockers:

  1. Fix mergeable_state (resolve CI/status checks)
  2. Fix changelog duplicate "0.20.0" entry (one should be removed or have unique content)
  3. Clarify Maven Central manual approval step: does workflow auto-promote or does operator need to click "Publish"?
  4. Document workflow_dispatch restrictions (who can manually trigger release?)

Nice-to-have:

  1. Add workflow approval/environment requirement for workflow_dispatch trigger
  2. Automate version bumping (consider version.gradle or gradle.properties property)
  3. Document required secret setup: GPG key export, API key generation links
  4. Explain --no-configuration-cache rationale
  5. Document Maven Central approval step (auto vs manual)

Summary: Well-designed release automation removing manual error-prone steps. Workflow structure is solid, secret handling improved. Main concerns are: (1) CI blocker, (2) changelog duplicate, (3) unclear if Maven Central approval is automated or manual, (4) version bumping still manual. Once CI passes and release process is clarified (especially Maven Central approval), this is merge-ready.

@runningcode runningcode merged commit cde11c8 into master Mar 14, 2026
2 checks passed
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.

3 participants