You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DEV-1115 One-click Android API release workflow - #123
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 .aarand 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
Publishing re-enabled: the library's publishing block had been commented out since Feb 2024, because it read a github.properties file that most checkouts lack. Credentials now come from gpr.user/gpr.key or GITHUB_ACTOR/GITHUB_TOKEN, so a build without them still configures. The target moves from ShimmerEngineering to ShimmerResearch.
gradlew made executable: it was committed as 100644, so ./gradlew failed with "Permission denied" on Linux.
Token hardening, the same as Shimmer-Java-Android-API#324: checkouts don't leave the token in .git/config, and only the publish job can write packages. actions/* steps are pinned to commit SHAs, matching DEV-1115 Add CI build of the library and every example #124.
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.
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]>
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]>
@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?
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.
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]>
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.
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]>
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
3.2.9Betaspelling counts as3.2.9_beta, so the next is3.2.10_beta. Or type a version.shimmerdriverandshimmerbluetoothmanager) to build against. Blank means the newestAPI_vrelease. Typing an older one lets you release against an earlier driver. It must have anAPI_vrelease.Its jobs:
v3.2.8Beta/AndroidAPI_v3.2.9Betaspellings. It builds the release.aarand every example app against the chosen driver, so the combination that ships is built before anything is published. It is read-only, withpackages: readonly to resolve the driver, because it also runs on PRs.packages: write. It builds the.aarthe same way, publishes it, and keeps the file it published for the release.AndroidAPI_v<version>on the commit it built and creates the GitHub Release with the.aarattached. 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 tolocal. The driver pins in the rootbuild.gradleread-PdriverVersion, defaulting to0.11.7_beta: that is whatmaster, 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 thatmaster's default driver falls behind until someone updates it.dry_runbuilds without publishing, from any branch. This workflow also dry-runs on any PR that changes it, building againstmaster's default driver.Also in this PR
publishingblock had been commented out since Feb 2024, because it read agithub.propertiesfile that most checkouts lack. Credentials now come fromgpr.user/gpr.keyorGITHUB_ACTOR/GITHUB_TOKEN, so a build without them still configures. The target moves fromShimmerEngineeringtoShimmerResearch.gradlewmade executable: it was committed as 100644, so./gradlewfailed with "Permission denied" on Linux.localpublishes (DEV-1115 Refuse a 'local' publish; add job timeouts #126): without-PreleaseVersion, publishing to a remote repository fails instead of pushing versionlocal..git/config, and only thepublishjob can write packages.actions/*steps are pinned to commit SHAs, matching DEV-1115 Add CI build of the library and every example #124.ci.ymlonly builds them againstmaster's default driver. Both build steps pass the 4 GB daemon heap from DEV-1115 Give the CI Gradle daemon 4 GB and a 30-minute timeout #125.gpr.usraccepted as well asgpr.userin the publishing block, since the rootbuild.gradlereadsgpr.usr(raised in DEV-1115 Refuse a 'local' publish; add job timeouts #126).Testing
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'sci.ymlcommand plus-PdriverVersion.GITHUB_TOKEN, so no extra secret is needed, and a 1.3 MB.aarwas built.3.2.10_betaagainst driver0.11.8_beta.0.11.7_beta.3.2.9_beta, which is already released asAndroidAPI_v3.2.9Beta, and a driver with noAPI_vrelease.AndroidAPI_v3.2.10_beta, returns the expected changelog. Nothing was created.0.11.8_beta, andshimmerbluetoothmanager0.11.8_beta was never published. Release Java0.11.9_betafirst, which publishes all three.🤖 Generated with Claude Code