Skip to content

UID2-7263 Skip SNAPSHOT publishing in Android SDK build workflow#146

Open
cYKatherine wants to merge 1 commit into
mainfrom
kchen-UID2-7263-skip-snapshot-publish
Open

UID2-7263 Skip SNAPSHOT publishing in Android SDK build workflow#146
cYKatherine wants to merge 1 commit into
mainfrom
kchen-UID2-7263-skip-snapshot-publish

Conversation

@cYKatherine

Copy link
Copy Markdown
Contributor

Summary

The build.yml "Deploy to Maven Central" step runs ./gradlew publish on every push to main. The project is configured with SONATYPE_HOST=CENTRAL_PORTAL (gradle.properties), which routes publishes to central.sonatype.com. The Sonatype Central Portal does not support SNAPSHOT publishing — with the current VERSION_NAME=2.2.0-SNAPSHOT, the step fails with a 403 Forbidden on every push to main.

Change

  • Added a Read version name step that extracts VERSION_NAME from gradle.properties into a step output.
  • Gated the publish step with !endsWith(steps.version.outputs.name, '-SNAPSHOT') so it only runs for release (non-SNAPSHOT) versions.
  • Renamed the step from "Deploy SNAPSHOT to Maven Central" to "Deploy to Maven Central" to reflect that it now only publishes releases.

Acceptance criteria

  • Pushes to main no longer fail due to the SNAPSHOT publish step (step is now skipped for -SNAPSHOT)
  • Release (non-SNAPSHOT) versions are still published via the workflow (condition allows them through)

References

🤖 Generated with Claude Code

The "Deploy to Maven Central" step ran ./gradlew publish on every push to
main. With SONATYPE_HOST=CENTRAL_PORTAL and VERSION_NAME=2.2.0-SNAPSHOT, the
Central Portal rejects SNAPSHOTs with a 403 Forbidden, failing every build.

Read VERSION_NAME from gradle.properties and gate the publish step so it only
runs for non-SNAPSHOT (release) versions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cYKatherine cYKatherine self-assigned this Jul 21, 2026
@cYKatherine
cYKatherine requested a review from mcollins-ttd July 21, 2026 06:47
@mcollins-ttd

Copy link
Copy Markdown
Contributor

Looking at the run history, we've had two successful runs that seem to have published snapshot versions since the 403:

https://github.com/IABTechLab/uid2-android-sdk/actions/workflows/build.yml?query=branch%3Amain

I recommend we close this without merging.

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