Skip to content

DEV-1115 One-click Android API release workflow - #123

Merged
MAzalya merged 12 commits into
masterfrom
DEV-1115_release_workflow
Oct 19, 2026
Merged

MAzalya merged 12 commits into
masterfrom
DEV-1115_release_workflow

Conversation

@JongChern

@JongChern JongChern commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

A one-click release for the Android API: Actions → Release Android API → Run workflow on master. It is the companion to ShimmerResearch/Shimmer-Java-Android-API#324. No uprev PR is needed.

How a release goes

Run the workflow. Both boxes can stay blank:

  • version — blank means the next patch after the last Android release. The older 3.2.9Beta spelling counts as 3.2.9_beta, so the next is 3.2.10_beta. Or type a version.
  • driver_version — the Shimmer-Java-Android-API release (shimmerdriver and shimmerbluetoothmanager) to build against. Blank means the newest API_v release. Typing an older one lets you release against an earlier driver. It must have an API_v release.

Its jobs:

  • build refuses a version that is already tagged, including the older v3.2.8Beta / AndroidAPI_v3.2.9Beta spellings. It builds the release .aar and every example app against the chosen driver, so the combination that ships is built before anything is published. It is read-only, with packages: read only to resolve the driver, because it also runs on PRs.
  • publish runs only on a real release and is the only job with packages: write. It builds the .aar the same way, publishes it, and keeps the file it published for the release.
  • release tags AndroidAPI_v<version> on the commit it built and creates the GitHub Release with the .aar attached. The notes start with the driver version it was built against, then the generated changelog. The .aar's POM lists no dependencies, so that line tells users which driver to add.

Neither version is stored in the source. The library's publishing block reads -PreleaseVersion, falling back to local. The driver pins in the root build.gradle read -PdriverVersion, defaulting to 0.11.7_beta: that is what master, the example apps and local builds use. A release's tag plus the driver version in its notes rebuild the same .aar. The trade-off is that master's default driver falls behind until someone updates it.

dry_run builds without publishing, from any branch. This workflow also dry-runs on any PR that changes it, building against master's default driver.

Also in this PR

Testing

  • This PR's dry run now also runs the example build, against master's default driver as a PR run does. On a real release it uses the chosen driver. The command is DEV-1115 Add CI build of the library and every example #124's ci.yml command plus -PdriverVersion.
  • Earlier dry run on this PR: it passed. The driver was read from Shimmer-Java-Android-API's GitHub Packages using this repo's GITHUB_TOKEN, so no extra secret is needed, and a 1.3 MB .aar was built.
  • The version step, run locally against the real tags and releases:
    • Blank boxes give 3.2.10_beta against driver 0.11.8_beta.
    • A PR run uses 0.11.7_beta.
    • It refuses 3.2.9_beta, which is already released as AndroidAPI_v3.2.9Beta, and a driver with no API_v release.
  • Release notes: the release-notes API, called for AndroidAPI_v3.2.10_beta, returns the expected changelog. Nothing was created.
  • Not yet possible: a real release with blank boxes would pick driver 0.11.8_beta, and shimmerbluetoothmanager 0.11.8_beta was never published. Release Java 0.11.9_beta first, which publishes all three.

🤖 Generated with Claude Code

JongChern and others added 5 commits October 15, 2026 12:11
Actions -> "Release Android API" releases the version in the library's
publishing block (bumped by the usual uprev PR; master is protected):
- warns when the shimmerdriver/shimmerbluetoothmanager pins are older
  than the newest Java API release, the drift DEV-1115 describes
- builds the release .aar and publishes it to GitHub Packages
- tags AndroidAPI_v<version> and creates the GitHub Release with the .aar

Re-enable the library's publishing block, commented out since Feb 2024
because it read a github.properties file that most checkouts lack. It
now reads gpr.user/gpr.key or GITHUB_ACTOR/GITHUB_TOKEN, so a build
without credentials still configures, and publishes to ShimmerResearch
instead of ShimmerEngineering.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Releases before this workflow were tagged AndroidAPI_v3.2.9Beta and
v3.2.8Beta, so the AndroidAPI_v<version> check alone would let an
un-bumped 3.2.9_beta be released a second time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The version in the build files is normally one that has already been
released until the next uprev, so stopping there made every PR dry run
end before the build it is meant to test. Dry runs now warn; a real
release still refuses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gradlew was committed as 100644, so ./gradlew fails with Permission
denied on Linux runners (and on any Linux or macOS checkout). Found by
this PR's own dry run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Release Android API now takes both from the Run form instead of from
committed build files:
- version: blank = next patch after the last release, reading the
  older 3.2.9Beta tag spelling as 3.2.9_beta (-> 3.2.10_beta)
- driver_version: the Shimmer-Java-Android-API release to build
  against; blank = the newest API_v release. It must have an API_v
  release. PR dry runs use master's default.

The library's publishing version reads -PreleaseVersion ('local'
otherwise), and the shimmerdriver/shimmerbluetoothmanager pins read
-PdriverVersion, defaulting to master's 0.11.7_beta. The .aar's POM
lists no dependencies, so each release's notes now start with the
driver version it was built against; that line and the tag rebuild
the same .aar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Re-enabling the publishing block means a hand-run `gradlew publish`
without -PreleaseVersion would push version 'local' to GitHub Packages,
where it can never be overwritten; developers already keep gpr.key in
GRADLE_USER_HOME for reading the driver. Publishing to a remote
repository now refuses 'local'; publishToMavenLocal is unaffected.

Add job timeouts so a hung Gradle daemon cannot hold a runner for the
default 6 hours (as happened to the CI run on #124).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…w_fixes

DEV-1115 Refuse a 'local' publish; add job timeouts
Copilot AI lite review requested due to automatic review settings October 18, 2026 05:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical workflow security and Gradle build issues remain.

3 open issues
What changed in this PR

Adds a one-click Android API release workflow with configurable versions, GitHub Packages publishing, and an executable Gradle wrapper.

Changes:

  • Adds manual release and PR dry-run automation.
  • Parameterizes driver and publication versions.
  • Re-enables Maven publishing.
File Summary and review findings
ShimmerAndroidInstrumentDriver/​ShimmerAndroidInstrumentDriver/​build.gradle Configures publishing. Critical missing task import (2 votes); moderate credential mismatch (2 votes); documentation destination nit (1 vote).
ShimmerAndroidInstrumentDriver/​gradlew Adds the executable Gradle wrapper.
ShimmerAndroidInstrumentDriver/​build.gradle Adds configurable driver dependency versions.
.github/​workflows/​release.yml Implements release automation. Critical PR token permission issue (1 vote); moderate duplicate-tag check (1 vote) and incomplete driver artifact validation (1 vote).

Review effort: Lite

Comment thread .github/workflows/release.yml Resolved
*/
// Without -PreleaseVersion the version is 'local', and GitHub Packages never lets a version be
// overwritten. Releases go through the Release Android API workflow; publishToMavenLocal is unaffected.
tasks.withType(PublishToMavenRepository).configureEach {
Same hardening as Shimmer-Java-Android-API#324:
- The build job ran on PRs with packages:write. Any code in a job can
  recover that job's token, so it now has packages:read only (enough to
  resolve the driver), and a new publish job, which runs only on a real
  release, is the one place with packages:write. It builds and publishes
  the .aar and uploads the file it published, so the GitHub Release
  carries the same .aar as GitHub Packages. The release job waits for it.
- Both checkouts set persist-credentials: false, so the token is not
  left in .git/config for the Gradle build to read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 18, 2026 06:16
@JongChern
JongChern requested a review from MAzalya October 18, 2026 06:19
@JongChern

Copy link
Copy Markdown
Contributor Author

@MAzalya thanks for #126, it's merged. Since then this has the same token hardening as Shimmer-Java-Android-API#324:

  • The build job is read-only. It keeps packages: read to resolve the driver.
  • A publish job runs only on a real release.
  • The token isn't left in .git/config.

The description is updated and the dry run is green. Your two notes (the examples aren't built against the chosen driver; gpr.user vs gpr.usr) are still open as follow-ups. Could you take another look?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Three moderate issues remain in version validation, repository credentials, and Gradle task configuration.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Version normalization misses existing legacy release spelling

.github/​workflows/​release.yml:127

The input validator accepts the older 3.2.9Beta spelling, but this conversion only derives the legacy spelling from an _beta input. If AndroidAPI_v3.2.9_beta already exists and someone enters 3.2.9Beta, none of the three checked tags matches it and the workflow can create a duplicate release under a second spelling. Normalize the requested version first, or check both canonical and legacy spellings in both directions.

1 resolved since last review

Review effort: Lite

Three follow-ups ahead of review:
- The release build job now also builds every example app against the
  driver this release ships with, before anything is published. ci.yml
  only ever builds them against master's default driver, so a release
  that picks a newer driver was never built with the examples (raised
  in #126). Both build steps pass the 4 GB daemon heap from #125.
- The publishing block accepts gpr.usr as well as gpr.user, since the
  root build.gradle reads gpr.usr (also raised in #126).
- actions/* steps are pinned to commit SHAs, matching #124: each is the
  commit its v4 tag points at today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 18, 2026 06:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Two moderate issues remain in the publishing build script and release tag validation.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Low severity README documents outdated Maven repository coordinates

ShimmerAndroidInstrumentDriver/​ShimmerAndroidInstrumentDriver/​build.gradle:96

This changes the publication endpoint to ShimmerResearch, but the public README still directs consumers to ShimmerEngineering's package repository and the old coordinates (README.md:19, 55-73). A release produced here will therefore not be discoverable or usable from the documented setup; please update the package URL/coordinates and migration instructions with this change.

1 resolved since last review

Review effort: Lite

@MAzalya MAzalya left a comment

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.

Approved. The publish/build split, the pinned SHAs (they match their tags), the gpr.usr fallback and the example build against the chosen driver all look good. All 12 modules built in the dry run.

Non-blocking nit: the build job also runs on PRs, but it still uses TOKEN: ${{ secrets.PACKAGES_READ_TOKEN || github.token }}. #124 deliberately moved to GITHUB_TOKEN only so that PR build scripts can't read a long-lived token. Worth matching here. That secret isn't set today, so nothing is exposed.

shimmerdriver gained net.java.dev.jna:jna and jna-platform 5.18.1 in
April (97bd44ab in Shimmer-Java-Android-API) for the desktop USB debug
listeners, and 0.11.8_beta onwards carries them. Android had only ever
built against 0.11.7_beta, so nothing saw it until now: against
0.11.9_beta every app fails packaging with "2 files found with path
'META-INF/AL2.0'" from the two JNA jars. A release with the driver box
blank would stop at "Build every example against the chosen driver".

JNA is desktop-only and nothing on Android loads those classes, so
exclude it, as io.netty already is.

Checked locally (JDK 17): with -PdriverVersion=0.11.9_beta the release
.aar and assembleDebug in all 12 modules build; with the default driver
(0.11.7_beta) all 12 still build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
MAzalya and others added 2 commits October 19, 2026 11:18
Excluding JNA in this repo's build.gradle does not reach apps that
consume the published .aar: its POM lists no dependencies, so they add
the driver themselves and would hit the same META-INF/AL2.0 clash with
driver 0.11.8_beta or later. The generated notes now say to exclude
net.java.dev.jna and link the exclusions this library builds with.
Raised by the Copilot review on #127.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
DEV-1115 Exclude JNA from the driver on Android
Copilot AI lite review requested due to automatic review settings October 19, 2026 07:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate findings must be addressed before approval.

2 open issues

Review effort: Lite

Comment on lines +127 to +128
legacy=${VERSION/_beta/Beta}
for t in "$TAG" "AndroidAPI_v$legacy" "v$legacy"; do
@MAzalya
MAzalya merged commit 3df8b98 into master Oct 19, 2026
4 checks passed
@MAzalya
MAzalya deleted the DEV-1115_release_workflow branch October 19, 2026 07:27
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