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
Releases now publish to https://maven.stirlingpdf.com (Cloudflare R2) first, since Maven Central now requires a paid Publisher Pro plan for us.
Uploads go through the shared Stirling-Tools/maven-r2-publish actions, pinned by SHA; JPDFium no longer carries its own upload scripts.
release.yml uses maven-r2-publish/release: stage to staging/JPDFium/<run>/, the six-platform verify against its staging-url, promote the exact staged files only if all pass, then cleanup. Released versions can't be overwritten.
dryRun stages and verifies on every platform, then deletes staging without releasing.
When verify or promote fails, staging is kept so "Re-run failed jobs" can finish; an interrupted promote resumes.
CLI binaries attach to the GitHub release only after promote, from a job that alone has contents: write.
The release version is validated (^[0-9A-Za-z._-]+$) and reaches every script through env:.
After the R2 release, publish-central sends the same version to Maven Central (auto-release) and verify-central probes it on all six platforms. Both are continue-on-error, so a Central failure never fails the release; uploads to Central run one at a time (central-portal concurrency group).
mirror-central-to-r2.yml wraps maven-r2-publish/mirror: versions (all = newest latest, default 5, or a list), destination prefix (empty is the live root), dryRun, and an optional six-platform smoke per copied version. Versions already there are skipped; every file is sha1-checked against Central and against what R2 serves.
NativeDownloader runtime downloads, README, install/config/native-loading docs, the example project and CHANGELOG now point at the new repository.
Verified:
Earlier on this branch: 1.1.6 and 1.2.0 copied from Central to R2 (1.2.0 passed the six-platform verify); a full test release 0.0.0-citest.1 staged, verified, promoted and then deleted; Stirling-PDF resolved JPDFium from R2 with Central blocked and auto-redaction worked in the running app.
The shared actions pass 23 end-to-end checks in their own CI against an S3 server: byte-for-byte mirror of 1.0.0 from Central, resume of an interrupted upload and promote, refusal of changed bytes, Maven pre-release ordering.
NativeDownloaderTest (15 tests, including the new default-repository test) passes.
This branch's real publishAllToR2Staging output went through stage → promote → cleanup locally against that server: 85 of 85 files served unchanged, metadata written for all four modules, staging removed.
Not verified yet: the shared actions against real R2, and the Central jobs end to end. Both run on the next real release.
Not changed here: snapshot.yml (Central snapshots on every push to main), publish-github-packages.yml, compatibility.yml (baseline from Central), and the Maven Central README badge.
After merge: run release.yml with dryRun once to exercise real R2, then mirror-central-to-r2.yml with versions=all to add 1.1.4, 1.1.5, 1.3.0 and 1.3.1; R2 currently has 1.1.6 and 1.2.0.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
JPDFium artifacts are available from the Stirling Maven repository, now the default source for runtime native downloads. A configurable repository override remains available.
Added an option to mirror JPDFium releases from Maven Central, with optional cross-platform smoke tests.
Changes
Releases are staged and verified in the Stirling Maven repository before promotion and submission to Maven Central.
Updated installation guidance and examples to configure the Stirling repository for com.stirling artifacts.
The release workflow stages signed artifacts in R2, verifies them, promotes them when dryRun is false, and submits them to Maven Central. A manual workflow mirrors selected Maven Central releases to R2. Documentation, examples, and native downloads now use the Stirling Maven repository.
Changes: Stirling Maven repository
Layer / File(s)
Summary
R2 staging setup build.gradle.kts
Gradle configures an R2 staging repository for subprojects that apply maven-publish. The publishAllToR2Staging task aggregates subproject publication tasks.
Staged release and verification .github/scripts/verify-central.sh, .github/workflows/release.yml
The verifier accepts R2 mode and omits Authorization headers when no token is set. The release workflow stages and verifies artifacts, promotes them when dryRun is false, attempts Central publication, and cleans up staging under the configured conditions.
Central mirroring and platform checks .github/workflows/mirror-central-to-r2.yml
A manual workflow mirrors selected com.stirling:jpdfium releases from Maven Central to R2. Optional smoke checks verify copied versions across six platforms.
Gradle and Maven examples identify the Stirling Maven repository. NativeDownloader uses it by default and retains the configurable repository override. A test checks the default repository URL.
Possibly related PRs
Stirling-Tools/JPDFium#182: Both PRs change release dry-run behavior. This PR stages and verifies artifacts in R2; PR #182 publishes to Maven Local and skips verification.
Change: Feature
Merge Risk: Low · previous review 99195
Release publishing is mostly sound. Before relying on it, disable credential persistence and Gradle caching in the signing and attach jobs, and correct the dry-run summary and the blank-version handling on manual dispatch.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title identifies the main change: publishing releases to the Stirling Maven repository.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the template and explains the changes, purpose, testing, and remaining verification. Some checklist items remain unchecked.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📜 Review details⏰ Context from checks skipped due to timeout: 42
GitHub Check: prep-windows-icu
GitHub Check: Native bridge libFuzzer (ASan/UBSan, real PDFium)
[error] 28-28: shellcheck reported issue in this script: SC2012:info:9:15: Use find instead of ls to better handle non-alphanumeric filenames
(shellcheck)
.github/workflows/release.yml
[error] 1068-1068: shellcheck reported issue in this script: SC2086:info:2:81: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 LanguageTooldocs/native-loading.md
[locale-violation] ~11-~11: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ... time it runs and reuse the cached copy afterwards. This is disabled by default. Enable i...
(AFTERWARDS_US)
🪛 Ruff (0.16.9).github/scripts/maven_metadata.py
[error] 29-29: Using xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents
[info] 961-961: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 962-962: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[info] 988-988: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 990-990: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 1057-1057: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 1060-1060: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[info] 1086-1086: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[warning] 1086-1086: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
🔇 Additional comments: 5
.github/workflows/release.yml: 2
1042-1042: Gate promote on a successful verify-staging result.
needs: [publish, verify-staging] runs promote only when both succeed, because the default condition is success(). The explicit if: ${{ !inputs.dryRun }} replaces that default. A custom if without a status function drops the implicit success() check only when it contains a status function. Here it has none, so success() is still applied. No change is required.
997-997: Fix the verify-staging condition so a tag-less dispatch without a version does not skip verification and promote.
verify-staging runs only for tags or when inputs.version is set. On a workflow_dispatch without a version, verify-staging is skipped. promote then does not run, because a skipped dependency fails success(). The result is safe. Confirm that this is intended.
Also applies to: 1042-1042
build.gradle.kts: 1
330-350: LGTM!
.github/scripts/verify-central.sh: 2
5-9: LGTM!
Also applies to: 25-29, 264-264
169-182: 🔒 Security & Privacy
The Authorization credentials are scoped to the staging maven repository. The separate mavenCentral declaration has no credentials. In r2 mode, PORTAL_TOKEN and the exported VERIFY_TOKEN are empty, so Gradle does not configure authentication for R2. No change is needed.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Note
Follow-up findings are listed below so you can review them separately from inline comments.
Follow-ups (2)
Minor (2)
Minor · Reject a blank version on manual dispatch before staging. · release.yml:1093-1094
.github/workflows/release.yml:1093-1094 Minor · Functional Correctness · Quick win
Reject a blank version on manual dispatch before staging.
On a manual run with no version, the publish job's Resolve version step falls back to the branch name, such as main. It then stages that value. verify-staging and promote are skipped, and cleanup-staging deletes the staging copy, so the run ends without a release or an error. The version input description says the fallback applies only "on tag push".
Suggested fix
- name: Resolve version
id: v
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -z "$INPUT_VERSION" ]; then+ echo "ERROR: the version input is required for manual dispatch"+ exit 1+ fi
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "$INPUT_VERSION" ]; then
VERSION="$INPUT_VERSION"
else
Minor · Correct the publish summary on dry runs. Promotion to the root does not run. · release.yml:1040
.github/workflows/release.yml:1040 Minor · Functional Correctness · Quick win
Correct the publish summary on dry runs. Promotion to the root does not run.
The Summary step in the publish job writes "released to the root once every platform verifies" on every run. It has no if: guard. On a dry run, the promote job is skipped (if: ${{ !inputs.dryRun }}). The line therefore describes a promotion that does not happen.
Write a dry-run message in that case. Keep the existing line for other runs.
Suggested fix
- echo "https://maven.stirlingpdf.com/staging/${{ github.run_id }}/ - released to the root once every platform verifies." >> $GITHUB_STEP_SUMMARY+ if [ "${{ inputs.dryRun }}" = "true" ]; then+ echo "Dry run: this run does not promote to the public root." >> $GITHUB_STEP_SUMMARY+ else+ echo "https://maven.stirlingpdf.com/staging/${{ github.run_id }}/ - released to the root once every platform verifies." >> $GITHUB_STEP_SUMMARY+ fi
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
[warning] 1121-1121: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 1160-1160: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 1119-1119: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment
(undocumented-permissions)
[error] 1168-1168: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): omitting cache-disabled enables caching
(cache-poisoning)
Additional comments: 1
.github/workflows/release.yml: 1
1208-1208: Data Integrity & Integration
The inspection does not establish that the rebuilt archives differ or that their differences cause a verification failure. The proposed archive settings are already Gradle defaults. Independently generated signatures can differ, but that alone does not establish a defect.
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.
Description of Changes
release.ymlusesmaven-r2-publish/release:stagetostaging/JPDFium/<run>/, the six-platform verify against itsstaging-url,promotethe exact staged files only if all pass, thencleanup. Released versions can't be overwritten.dryRunstages and verifies on every platform, then deletes staging without releasing.contents: write.^[0-9A-Za-z._-]+$) and reaches every script throughenv:.publish-centralsends the same version to Maven Central (auto-release) andverify-centralprobes it on all six platforms. Both arecontinue-on-error, so a Central failure never fails the release; uploads to Central run one at a time (central-portalconcurrency group).mirror-central-to-r2.ymlwrapsmaven-r2-publish/mirror:versions(all= newestlatest, default 5, or a list),destinationprefix (empty is the live root),dryRun, and an optional six-platformsmokeper copied version. Versions already there are skipped; every file is sha1-checked against Central and against what R2 serves.NativeDownloaderruntime downloads, README, install/config/native-loading docs, the example project and CHANGELOG now point at the new repository.0.0.0-citest.1staged, verified, promoted and then deleted; Stirling-PDF resolved JPDFium from R2 with Central blocked and auto-redaction worked in the running app.NativeDownloaderTest(15 tests, including the new default-repository test) passes.publishAllToR2Stagingoutput went through stage → promote → cleanup locally against that server: 85 of 85 files served unchanged, metadata written for all four modules, staging removed.snapshot.yml(Central snapshots on every push to main),publish-github-packages.yml,compatibility.yml(baseline from Central), and the Maven Central README badge.release.ymlwithdryRunonce to exercise real R2, thenmirror-central-to-r2.ymlwithversions=allto add 1.1.4, 1.1.5, 1.3.0 and 1.3.1; R2 currently has 1.1.6 and 1.2.0.Checklist
General
## [Unreleased]inCHANGELOG.mdLibrary changes
.github/workflows/compatibility.ymlexcludes the break with a reasondocs/installation.md, and the POMsNative or FFM changes
bash native/build-real.sh./gradlew :jpdfium:integrationTestnative/bridge/include/jpdfium.hand the ABI notes for any ABI changeTesting
./gradlew testpasses