Repository navigation
Conversation
ktoso
force-pushed
the
ktoso/maven-publishing
branch
10 times, most recently
from
November 27, 2026 06:21
c0d82c7 to
f4a50b1
Compare
ktoso
marked this pull request as draft
November 27, 2026 06:28
Publish `swiftkit-core`, `swiftkit-ffm` and `swiftkit-native` under the `org.swift.swiftjava` group with Gradle's `maven-publish` and `signing` plugins, like ServiceTalk does, without a publishing plugin dependency: - `.github/workflows/publish.yml`: a push to `main` publishes a `-SNAPSHOT` to the Central Portal snapshots repository, a pushed `N.N.N` tag publishes that release to Maven Central. The full test suite (`pull_request.yml`, now also a reusable workflow) has to pass first. The native libraries are then built on every platform, and one job signs and uploads everything, after the Gradle wrapper jar it runs with the secrets was checked against the checksum Gradle publishes (by hand, the organization doesn't allow third-party actions). `gradle-wrapper.jar` is updated to the one of Gradle 9.4.0, the version in `gradle-wrapper.properties` (it was 9.1.0's). - Releases are uploaded to the Central Portal's OSSRH Staging API and turned into a deployment with `publishing_type=automatic`, so Central publishes them once validated, without a manual step in the Portal. `.github/scripts/central-release.sh` polls the Portal until Central has validated the deployment and fails the run, with Central's errors, if Central rejects it. - Until the repository variable `MAVEN_CENTRAL_PUBLISHING` is `true`, every run is a dry run: it publishes everything signed to `build/staging-deploy` and verifies every signature, but uploads nothing. Pull requests that change the publishing setup always dry-run, with a throwaway signing key when the real one isn't available. - Credentials (`SONATYPE_USER`, `SONATYPE_TOKEN`) and the signing key (`ORG_GRADLE_PROJECT_SIGNINGKEY`, `ORG_GRADLE_PROJECT_SIGNINGPASSWORD`) come from GitHub secrets and are only passed to the publish step. Publishing to Maven Central without them fails before anything runs. - The version is derived from git tags in the root `build.gradle.kts`: the tag when HEAD is at a release tag, otherwise the next patch `-SNAPSHOT`. The publish job marks the checkout as a safe git directory, since the container runs as another user than the checkout's owner. This replaces `resolveSwiftKitVersion()`. - `swiftkit-native` ships `libSwiftJava` and `libSwiftRuntimeFunctions` as one classifier jar per platform (`osx-aarch_64`, `ubuntu24.04-swift_6.3-x86_64`, ...), with the libraries at the jar root, where `SwiftLibraries.loadResourceLibrary` looks for them. - `build-logic.java-publishing-conventions` adds the POM metadata Maven Central requires, signing, and the `staging` and `sonatype` repositories. - `swiftkit-ffm` exposes `swiftkit-core` as an `api` dependency (compile scope in the POM), since its public API extends core types such as `SwiftArena`. - `PUBLISHING.md` documents the artifacts and how to depend on them, `RELEASING.md` the maintainer setup, enabling publishing and the release process. `README.md` shows how to pick the `swiftkit-native` classifier with the osdetector Gradle plugin.
ktoso
force-pushed
the
ktoso/maven-publishing
branch
from
November 27, 2026 06:48
efe8601 to
ba1f26e
Compare
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.
Good news! We're finally going to be publishing Java library releases to Maven Central!
This prepares for publishing all the java artifacts of SwiftJava to Maven Central, under the
org.swift.swiftjavagroup.The intent is to both publish:
This is only dry running for now. We want to make sure we have the right publishing steps in place, also for the binary parts of the release including
swiftkit-nativewhich needs to be built for different platforms:osx-aarch_64,ubuntu24.04-swift_6.3-x86_64, etc.🚧 🚧 Work in progress while we verify all the build steps and keys / signing etc 🚧 🚧