Repository navigation
DEV-1115 One-click Java API release workflow, with the MATLAB jar - #324
Merged
Merged
Conversation
Process.onExit() is Java 9+. ShimmerJavaClass.jar is built as Java 8 bytecode for MATLAB, and source/target 1.8 compiled this call without complaint, so starting the BLE gRPC server from MATLAB on Java 8 would throw NoSuchMethodError. The jar currently in Shimmer-MATLAB-ID/libs (built 2025-11-24) contains the call. Wait on the process in a daemon thread instead, which logs the same exit message. Found by building the jar with --release 8. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Actions -> "Release Java API" releases the version already in the build files (bumped by the usual uprev PR; master is protected): - tests and builds as gradle.yml does - publishes shimmerdriver, shimmerbluetoothmanager and shimmerdriverpc in one gradlew publish, so they cannot drift apart again - tags API_v<version> and creates the GitHub Release with the jars, not marked Latest - builds ShimmerJavaClass.jar as Java 8 bytecode on its own runner and opens a PR replacing Shimmer-MATLAB-ID/libs/ShimmerJavaClass.jar (needs the MATLAB_REPO_TOKEN secret) ShimmerDriverPC gains -PmatlabJava8, which compiles all three projects with --release 8 in place of hand-editing three build files to 1.8. Publishing URLs move from ShimmerEngineering, now a user account, to ShimmerResearch. AGENTS.md documents the release steps. 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]>
The version no longer lives in the source. The three publishing blocks read -PreleaseVersion (falling back to 'local'), and Release Java API passes it: the version typed in the Run form, or by default the next patch after the last API_v release (0.11.8_beta -> 0.11.9_beta). The API_v tags record what was released, so a release needs no uprev PR and nothing has to be committed to the protected master. Checked locally: with -PreleaseVersion=0.11.9_beta all three POMs and their dependencies on each other are 0.11.9_beta; without it, 'local'. Co-Authored-By: Claude Opus 5.5 <[email protected]>
publish failed on shimmerdriverpc with "multiple artifacts with the
identical extension and classifier ('jar', 'null')": the Shadow plugin
adds ShimmerJavaClass.jar (empty classifier) to components.java, and
Gradle 8.14 (DEV-1013) rejects the clash. The PR dry run skips publish,
so the first real release would have failed there after publishing the
other two. Skip the shadow variant, which publishes the plain jar with
its dependencies in the POM, as 0.11.7_beta was.
Without -PreleaseVersion the version is 'local', and a hand-run
`gradlew publish` would push that to GitHub Packages, where it can
never be overwritten. 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.
Checked locally (JDK 11): publishToMavenLocal -PreleaseVersion=0.0.0_test
now succeeds, all three POMs and their cross-dependencies read
0.0.0_test, and shimmerdriverpc is the 140 KB thin jar. Publishing to a
file repository without -PreleaseVersion fails for all three.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
DEV-1115 Fix shimmerdriverpc publish; refuse a 'local' publish
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical credential-exposure and dependency-version issues, plus workflow release-validation gaps, remain unresolved.
4 open issues
What changed in this PR
Adds one-click Java API release automation, MATLAB JAR updates, Java 8 support, and package URL/versioning changes.
Changes:
- Adds release, validation, publishing, and MATLAB PR workflows.
- Adds Java 8-compatible compilation and process monitoring.
- Updates publishing configuration and release documentation.
| File | Description |
|---|---|
ShimmerPCBasicExamples/build.gradle |
Updated package URL |
ShimmerLSL/build.gradle |
Updated package URL |
ShimmerDriverPC/build.gradle |
Java 8 build and publication configuration |
ShimmerDriver/src/main/java/com/shimmerresearch/grpc/GrpcBLERadioByteTools.java |
Java 8-compatible process monitoring |
ShimmerDriver/build.gradle |
Versioning and repository configuration |
ShimmerBluetoothManager/build.gradle |
Versioning and repository configuration |
AGENTS.md |
Release process documentation |
.github/workflows/release.yml |
Release, validation, and MATLAB automation |
Review effort: Lite
actions/checkout persists github.token in .git/config by default, so the Gradle build in the build job, and any plugin or dependency it runs, could read a token with packages:write. Neither build nor matlab-jar needs git credentials after checkout, so turn persistence off there. update-matlab keeps it, because its git push uses it. Raised in review on #324. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The build job ran on PRs with packages:write. Any code in a job can recover that job's token from the runner, so a PR dry run should not hold a write token at all. The build job is now read-only, and a new publish job, which runs only on a real release, is the one place with packages:write. It publishes and uploads the jars it published, so the GitHub Release carries the same files as GitHub Packages. The release job now waits for it. Raised in review on #324. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The check sampled three of our own classes, but ShimmerJavaClass.jar also shades every dependency, and one built for a later Java would break MATLAB on Java 8 just the same. Check every class instead (about 32,500, read once with Python in ~2 s), skipping module-info and META-INF/versions entries, which Java 8 never loads, and still require the main class to be present. Tested on a fresh -PmatlabJava8 build (32,510 classes, all Java 8 or older, passes), and on jars missing the main class or carrying a Java 11 dependency class (both fail, naming the class). Raised in review on #324. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
@MAzalya thanks for #327, it's merged. Since then:
All Copilot threads are resolved and the dry run is green. Could you take another look? |
Matches ShimmerAndroidAPI#124, which pinned checkout and setup-java in review. Each pin is the commit its v4 tag points at today (checkout v4.4.0, setup-java v4.9.1, upload-artifact v4.6.2, download-artifact v4.3.0), so nothing that runs changes; setup-gradle was already pinned. Co-Authored-By: Claude Opus 5.5 <[email protected]>
MAzalya
approved these changes
Oct 19, 2026
MAzalya
left a comment
Contributor
There was a problem hiding this comment.
Approved. I re-reviewed the changes since #327:
- The publish job is the only job with packages:write.
- Credentials aren't persisted.
- The pinned SHAs match their tags.
- The matlab-jar check passed: 32,510 classes, all Java 8 or older. (The #327 description said 39,510; I added it up wrong.)
MATLAB_REPO_TOKEN is already set, so the first real release exercises publish, release and update-matlab.
Non-blocking nits, on ShimmerAndroidAPI#123 and #124 rather than here:
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 Java API: Actions → Release Java API → Run workflow on
master. It publishes to GitHub Packages, creates the GitHub Release, and updates the MATLAB jar. No uprev PR is needed.How a release goes
API_vrelease (0.11.8_beta→0.11.9_beta), or type one such as0.12.0_beta.gradle.ymldoes.packages: write(the only job with it)gradlew publish -PreleaseVersion=…, then keeps the jars it published for the release.ShimmerJavaClass.jarwithshadowJar -PmatlabJava8on its own runner, then checks that every class in it, dependencies included, is Java 8 bytecode.contents: writeAPI_v<version>and creates the GitHub Release with the jars and generated notes. It is not marked Latest, so Latest stays on Consensys.libs/ShimmerJavaClass.jar.Publishing all three artifacts together fixes how
shimmerbluetoothmanager0.11.8_beta came to be missing: they were published by hand one at a time (DEV-1115).The version is no longer stored in the source. The three publishing blocks read
-PreleaseVersion. They fall back tolocal, and refuse to publishlocalto a remote repository. Nothing has to be committed to the protectedmaster, and theAPI_vtags record what was released. Nothing else reads the version: every past uprev PR changed only these three lines.dry_runrunsbuildandmatlab-jarwithout publishing, from any branch. This workflow also dry-runs on any PR that changes it, including this one.Also in this PR
shimmerdriverpcpublish fixed (DEV-1115 Fix shimmerdriverpc publish; refuse a 'local' publish #327, @MAzalya): the Shadow plugin's variant clashed with the plain jar, sopublishfailed forshimmerdriverpcafter publishing the other two. The shadow variant is now left out of the publication. The thin jar goes out with its dependencies in the POM, as 0.11.7_beta did; the fat jar goes to MATLAB and the GitHub Release.-PmatlabJava8on ShimmerDriverPC compiles all three projects with--release 8. It replaces the Confluence step of hand-editing three build files to 1.8. UnlikesourceCompatibility = '1.8', it also rejects any API newer than Java 8.GrpcBLERadioByteToolscalledProcess.onExit(), which is Java 9+. The jar in Shimmer-MATLAB-ID today contains that call, so starting the BLE gRPC server from MATLAB on Java 8 would throwNoSuchMethodError. It now waits on the process in a daemon thread and logs the same message..git/config, and only thepublishjob can write packages.actions/*steps are pinned to commit SHAs, each the commit itsv4tag points at today.ShimmerEngineering, now a user account, toShimmerResearchin the five build files that had them.Before the first real release
MATLAB_REPO_TOKEN: a fine-grained token with resource owner ShimmerResearch, repository access limited to Shimmer-MATLAB-ID, and Contents and Pull requests read/write. Without it only the update-matlab job fails, and that job can be re-run on its own.Testing
shimmerdriverpcfailed while the other two published.shimmerdriverpcis the 140 KB thin jar, and the POMs and Gradle module metadata give their dependencies on each other the release version, with nounspecifiedanywhere.-PreleaseVersion, all three refuse and nothing is written.-PmatlabJava8build passes the full-class check (32,510 classes, all Java 8 or older). A jar missing the main class, or carrying a Java 11 dependency class, fails, and the offending class is named.0.11.9_betaafterAPI_v0.11.8_beta. It refuses0.11.8_beta(already tagged) and malformed input.🤖 Generated with Claude Code