Skip to content

Commit 5ec252b

Browse files
committed
fix(jvm): stop shipping the natives twice, and actually release Kotlin
Two separate problems, both visible from Maven Central. The sources JAR was 50.70 MB against 0.18 MB of actual Java source. `maven-source-plugin:jar-no-fork` sweeps `src/main/resources`, and the release job stages the five platform JNI libraries there before packaging — so every release uploaded 123 MB of binaries twice, once in the fat JAR where they belong and once in a "sources" JAR that an IDE opens to read `.java`. `excludeResources` ends that; nothing else lives under `src/main/resources`, which is empty in git. Measured locally with a staged native present: 3.1 MB fat JAR unchanged and still carrying it, sources JAR 83 KB with zero native entries. `fyi.oxide:pdf-oxide-kotlin` has never existed on Central. The publish job has run and reported success since v0.3.69, but `automaticRelease = false` leaves the deployment VALIDATED in the Portal for someone to release by hand, and nobody ever has. Java has published automatically since v0.3.56 and Scala does through sbt-ci-release; Kotlin was the one JVM artifact still waiting on a click that never came. It now matches them. The workflow's own text claimed Java staged too — a leftover from before v0.3.56 that had every reader believing a manual step was pending when `waitUntil=published` already blocks until the version is live. Step names and notices now say what the jobs do. Claude-Session: https://claude.ai/code/session_01GpmgN5Mc14eRa1w4NCJrTy Signed-off-by: Yury Fedoseev <yfedoseev@gmail.com>
1 parent 214e2fa commit 5ec252b

3 files changed

Lines changed: 38 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ jobs:
702702
# convention: the upload reaches VALIDATED state, then a human
703703
# flips the Publish button in the Central Portal UI.
704704
publish-maven:
705-
name: Publish to Maven Central (staged)
705+
name: Publish to Maven Central
706706
needs: [package-java-jar, create-release]
707707
runs-on: ubuntu-latest
708708
# Same convention as publish-npm / publish-pypi / publish-nuget:
@@ -741,24 +741,24 @@ jobs:
741741
path: java/src/main/resources/fyi/oxide/pdf/native/
742742
merge-multiple: true
743743

744-
- name: mvn deploy to Central Portal (autoPublish=false)
744+
- name: mvn deploy to Central Portal (autoPublish=true)
745745
working-directory: java
746746
env:
747747
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
748748
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
749749
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
750750
run: |
751751
# `release` profile turns on GPG signing + central-publishing-
752-
# maven-plugin with `autoPublish=false` per pom.xml. The
753-
# deployment reaches VALIDATED state in Central Portal; a
754-
# maintainer flips "Publish" manually from the UI (matches
755-
# feedback_release_gate — human gates the public publish).
752+
# maven-plugin, configured in pom.xml with autoPublish=true and
753+
# waitUntil=published: the step returns only once the version is
754+
# live on Central, so a green job here means it is downloadable.
755+
# The human gate is the tag, as it is for the other registries.
756756
mvn -B -P!dev -Prelease -DskipTests deploy
757757
758-
- name: Notice — Central Portal staging done
758+
- name: Notice — published to Maven Central
759759
run: |
760-
echo "::notice::Java JAR uploaded to Central Portal in VALIDATED state."
761-
echo "::notice::Sign in at https://central.sonatype.com/ and flip Publish to release."
760+
echo "::notice::Java JAR published to Maven Central (autoPublish, waitUntil=published)."
761+
echo "::notice::Verify: https://repo1.maven.org/maven2/fyi/oxide/pdf-oxide/"
762762
763763
# Package per-platform Go FFI tarballs as GitHub Release assets.
764764
#
@@ -2045,7 +2045,7 @@ jobs:
20452045
# upload reaches VALIDATED and a maintainer flips Publish — same human
20462046
# release-gate as publish-maven (Java).
20472047
publish-kotlin:
2048-
name: Publish Kotlin to Maven Central (staged)
2048+
name: Publish Kotlin to Maven Central
20492049
needs: [validate, create-release]
20502050
runs-on: ubuntu-latest
20512051
if: ${{ !contains(needs.validate.outputs.version, '-') && github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || inputs.publish) }}
@@ -2068,7 +2068,7 @@ jobs:
20682068
working-directory: java
20692069
run: mvn -q -B -P'!dev' -DskipTests install
20702070

2071-
- name: Publish to Maven Central Portal (VALIDATED; human flips Publish)
2071+
- name: Publish to Maven Central Portal
20722072
working-directory: kotlin
20732073
env:
20742074
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
@@ -2077,10 +2077,10 @@ jobs:
20772077
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
20782078
run: gradle publishToMavenCentral --no-daemon --console=plain
20792079

2080-
- name: Notice — Central Portal staging done
2080+
- name: Notice — published to Maven Central
20812081
run: |
2082-
echo "::notice::Kotlin artifact uploaded to Central Portal (VALIDATED)."
2083-
echo "::notice::Sign in at https://central.sonatype.com/ and flip Publish."
2082+
echo "::notice::Kotlin artifact published to Maven Central (automaticRelease)."
2083+
echo "::notice::Verify: https://repo1.maven.org/maven2/fyi/oxide/pdf-oxide-kotlin/"
20842084
20852085
# Scala facade → Maven Central via sbt-ci-release (already in
20862086
# scala/project/plugins.sbt). Credentials reuse the Java GPG/Sonatype

java/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,19 @@
257257
<groupId>org.apache.maven.plugins</groupId>
258258
<artifactId>maven-source-plugin</artifactId>
259259
<version>${maven.source.plugin.version}</version>
260+
<configuration>
261+
<!-- `jar-no-fork` sweeps src/main/resources, and the
262+
release job stages the five platform JNI natives
263+
there before packaging. That put 123 MB of
264+
binaries (50 MB compressed) into a "sources" jar
265+
whose actual sources are 0.18 MB, and shipped
266+
them to Central twice per release — once in the
267+
fat JAR, where they belong, and once here. An IDE
268+
attaches a sources jar to read .java; nothing
269+
reads a .dylib out of one. Nothing else lives
270+
under src/main/resources: it is empty in git. -->
271+
<excludeResources>true</excludeResources>
272+
</configuration>
260273
<executions>
261274
<execution>
262275
<id>attach-sources</id>

kotlin/build.gradle.kts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,18 @@ tasks.test {
6262
// Maven Central publishing (Sonatype Central Portal). Credentials + signing key
6363
// come from CI env (ORG_GRADLE_PROJECT_mavenCentralUsername / *Password /
6464
// signingInMemoryKey / *Password), same secrets family as the Java binding.
65-
// GPG-signs all publications; autoPublish is left to the release-gate workflow.
66-
// The host argument is gone from the plugin: post-OSSRH there is only the
67-
// Central Portal, so `publishToMavenCentral()` targets it unconditionally.
65+
// GPG-signs all publications. The host argument is gone from the plugin:
66+
// post-OSSRH there is only the Central Portal, so `publishToMavenCentral()`
67+
// targets it unconditionally.
68+
//
69+
// `automaticRelease = true` matches the Java binding's `<autoPublish>true` and
70+
// every other registry this project publishes to. With `false`, the tag job
71+
// succeeded while leaving the deployment VALIDATED in the Portal for a human
72+
// to release by hand — and since v0.3.69 nobody ever did, so
73+
// `fyi.oxide:pdf-oxide-kotlin` has never existed on Central. The release gate
74+
// is the tag, not a second click.
6875
mavenPublishing {
69-
publishToMavenCentral(automaticRelease = false)
76+
publishToMavenCentral(automaticRelease = true)
7077
signAllPublications()
7178
coordinates("fyi.oxide", "pdf-oxide-kotlin", version.toString())
7279
pom {

0 commit comments

Comments
 (0)