Skip to content

ci: Release every SDK artifact from one Release workflow - #768

Open
cdecker wants to merge 20 commits into
mainfrom
2026m11-release-public
Open

cdecker wants to merge 20 commits into
mainfrom
2026m11-release-public

Conversation

@cdecker

@cdecker cdecker commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

One place to release every SDK artifact: Actions > Release > Run workflow. A dry run, the default, builds, tests and packages everything up to the upload, from any branch and at any time. A real release, from main only, publishes whatever the registries don't have yet, so a re-run finishes a partly failed release. Pushing a tag no longer publishes anything.

release.yml (workflow_dispatch: dry_run, crates, python, npm, swift, maven)
  plan                 release_plan.py: version from the repo vs the registry → run summary table
  crates               publish-crates.yml   changelog, semver, tests, one multi-package cargo publish
  ├─ python            python.yml           wheels + sdist, twine check → PyPI (trusted publishing)
  ├─ npm               typescript.yml       native modules, tests, npm publish [--dry-run]
  ├─ swift             swift.yml            XCFramework → gl-sdk-v* release → gl-sdk-swift tags X.Y.Z
  └─ maven             kotlin.yml           unsigned bundle → gl-sdk-v* release → signed + uploaded internally

The crates go first, then the bindings in parallel, so a binding never ships a gl-sdk whose crates failed. The plan also fails on what only a registry would reject: wildcard dependencies (crates.io refused gl-signerproxy 0.4.0 for log = "*") and bindings whose versions disagree with gl-sdk.

Artifact Before After (one dispatch) Dry run stops after
crates release.yml per <crate>-vX.Y.Z tag publish-crates.yml cargo publish --dry-run of all crates together
gl-client, gl-sdk on PyPI published internally, one Linux wheel / never python.yml twine check --strict
@greenlightcln/glsdk every push to main with an unpublished version typescript.yml npm publish --dry-run
GreenlightSDK (Swift) gl-sdk-swift swift.yml, dispatched by hand swift.yml + gl-sdk-swift publish.yml gl-sdk-swift's prepare.sh + check-package.sh
com.blockstream:glsdk built and published internally, by hand kotlin.yml builds it, signed and uploaded internally check-bundle.sh, throwaway key

Neither repository holds credentials for another. Swift and Maven are pulled by their publisher, hourly, and release.yml waits for them, so the outcome still shows here:

sequenceDiagram
    participant R as release.yml
    participant Rel as gl-sdk-vX.Y.Z release
    participant S as gl-sdk-swift publish.yml (hourly)
    participant G as Blockstream release infra (hourly)
    participant C as Maven Central
    R->>Rel: XCFramework zip, glsdk.swift
    R->>Rel: glsdk-maven-X.Y.Z.zip (unsigned)
    S->>Rel: poll → Package.swift, tag X.Y.Z
    G->>Rel: poll → check checksum + uploader
    G->>C: sign with Blockstream key, upload
    R->>S: wait for tag X.Y.Z, verify like SwiftPM
    R->>C: wait for repo1.maven.org
Loading

No Maven Central credentials or signing key are on GitHub. The bundle is built and checked here and signed where the key is, outside this repository. The GitLab pipeline is gone (.gitlab-ci.yml, gitlab/), and with it the Maven -SNAPSHOT builds.

Also in here: gl-examples and uniffi-bindgen are publish = false (crates.io's uniffi-bindgen is someone else's), the gl-sdk wheel fixes (missing glsdk.py, Windows glsdk.dll, stale checksum, __version__), and macos-15 instead of the retired macos-14, which kept npm 0.3.1 from publishing.

The gl-client 0.8.0 / gl-sdk 0.5.1 release went out ahead of this, the old way, in #770. This branch is rebased onto it.

Evidence

  • Plan, python3 .github/scripts/release_plan.py against today's registries:
    | crates | gl-signerproxy        | 0.4.0 | crates.io        | no  | publish |
    | crates | gl-sdk-cli            | 0.4.1 | crates.io        | no  | publish |
    | crates | gl-sdk                | 0.5.1 | crates.io        | yes | skip, already published |
    | npm    | @greenlightcln/glsdk  | 0.3.1 | npm              | no  | publish |
    | swift  | GreenlightSDK         | 0.5.1 | gl-sdk-swift tag | yes | skip, already published |
    | maven  | com.blockstream:glsdk | 0.5.1 | Maven Central    | no  | publish |
    
    With log = "*" back in gl-signerproxy: error: gl-signerproxy: dependency log = "*", crates.io rejects wildcard requirements, exit 1.
  • Before: the dry run of release.yml never ran cargo publish.
    After: cargo publish --dry-run of an already published crate warns already exists on crates.io index and stops before the upload, so the dry run can cover every crate at any time.
  • Swift: gl-sdk-swift's scripts/verify.sh passes against the published 0.5.1 and 0.4.1. scripts/prepare.sh on the real 0.5.1 zip renders the package for a test version, and refuses a zip that doesn't match its checksum, or an empty glsdk.swift, which the old inline version would have committed.
  • Maven: contrib/maven-central/check-bundle.sh on a bundle in Gradle's layout signs and verifies all 11 files, writes the md5 and sha1 checksums, drops Gradle's checksums and maven-metadata.xml, warns about a missing javadoc jar, and refuses a wrong version or a bundle without one. The internal side was run against a local fake of this repository's releases: it signs the bundle, and refuses one not uploaded by the Release workflow.
  • actionlint and shellcheck pass on the changed workflows and scripts.
  • Not run yet: none of the workflows has run on GitHub with these changes, nor a real Central upload. This PR's checks run the builds; the first dispatched dry run exercises the rest.

Merge Danger

Door: one-way

Merging is safe on its own: every publish now waits for a dispatched run of release.yml. The first real release is the one-way step. Run a dry run first.

Blast Radius: registries

Before the first real release:

  • Publish from greenlight's releases again, with shared scripts gl-sdk-swift#8 has to merge first: every Swift build here runs its scripts/prepare.sh from gl-sdk-swift's main, so without it the Swift checks fail.
  • PyPI needs a trusted publisher on gl-client and a pending one on gl-sdk: owner Blockstream, repository greenlight, workflow release.yml (the workflow that starts the run, not python.yml), environment pypi.
  • Maven -SNAPSHOT builds stop. The last one is 0.5.1-08c004da-SNAPSHOT; releases are the only Maven artifacts from now on.
  • Merging no longer publishes npm 0.3.1. The first real release does.

GitHub's CARGO_REGISTRY_TOKEN and RELEASE_PLZ_TOKEN stay unused.

🤖 Generated with Claude Code

cdecker added 19 commits November 19, 2026 13:42
typescript.yml compared the package.json version against the parent
commit to decide whether to build, test and publish. A rebase-merge puts
the version bump below the tip, so the check saw no change and skipped
the publish: npm stayed at 0.1.1 while package.json moved to 0.2.0 and
0.3.0.

Check the registry's version list instead. A version missing from npm
is built, tested and published, whichever commit bumped it, and a
failed publish is retried by the next run. A failed registry request
fails the job rather than counting as unpublished.
The wheel left out the generated bindings: glsdk/glsdk.py is listed in
.gitignore, and hatchling skips ignored files unless they are
force-included, so `import glsdk` failed with "No module named
'glsdk.glsdk'". Force-include it like the shared library.

On Windows the hook packaged the library as glsdk/libglsdk.dll, while
the UniFFI loader opens glsdk/glsdk.dll, the name cargo gives it.

glsdk.__version__ was hard-coded to 0.4.0, read it from the installed
package's metadata instead.
The committed bindings predate the doc comment change on
Scheduler.lightning_available, which changed its UniFFI checksum, so
they refused to load against a current build of the library.
The gl-client Python package was published from the internal GitLab
mirror by a manual job that rewrote the version with sed and built a
single Linux wheel, and the gl-sdk Python package was not published or
even built anywhere.

python.yml now publishes both through PyPI trusted publishing, in the
`pypi` environment:

 - a gl-client-py-vX.Y.Z tag publishes gl-client from the wheels and
   sdist the workflow already builds;
 - a gl-sdk-vX.Y.Z tag publishes gl-sdk from a new set of wheels for
   Linux x86_64 and aarch64 (cargo zigbuild against glibc 2.17), macOS
   arm64 and x86_64, and Windows x64. Each wheel bundles the library
   with bindings regenerated from it, is retagged from py3-none-any to
   its platform, and is smoke tested where the runner can load it.

Both jobs refuse files whose version differs from the tag.

The release tags also match release.yml's crate tag pattern, so
release.yml now skips crates with `publish = false`, which gl-client-py
and gl-sdk-node set: they are released to PyPI and npm, not crates.io.
A gl-sdk-vX.Y.Z tag keeps publishing the gl-sdk crate as well.
gl-plugin, gl-signerproxy and gl-cli were published from the internal
GitLab mirror by manual jobs on date-stamped tags, which rewrote the
version with sed and published without the changelog and semver checks
release.yml runs. Publish them from release.yml like the other crates,
and leave the mirror with only the Maven Central pipeline.
List every published artifact with the workflow and trigger that
publishes it, document the Python release tags and their overlap with
the crate tags, and replace the npm and Python gaps with how the new
checks work and the PyPI setup they need.
The Swift package was built in Blockstream/gl-sdk-swift by a workflow
dispatched by hand after each gl-sdk release, so nothing built the
XCFramework before a release, and automating the dispatch from here
would need a token for the other repository.

Build it here instead. swift.yml builds the XCFramework and the Swift
bindings on changes to the SDK and compiles them as a Swift package for
the iOS simulator. On a gl-sdk-vX.Y.Z tag it attaches the zip, its
checksum and glsdk.swift to the gl-sdk-vX.Y.Z release, creating the
release if release.yml has not yet. gl-sdk-swift's publish.yml picks
them up from there, so each repository only writes to itself.
GitHub no longer runs jobs on macos-14 ("The configuration
'macos-14-arm64-us-default' is not supported"), which failed the gl-sdk
macOS wheels at once and would fail the npm aarch64-apple-darwin build
whenever it runs.
xcodebuild names the schemes of a Swift package itself, and the package
built to compile the bindings has no scheme named GreenlightSDK. List
the schemes and build the library product's, or the whole package's.
crates.io rejected gl-signerproxy 0.4.0 with "wildcard (`*`) dependency
constraints are not allowed on crates.io", for `log = "*"`. 0.4 is the
version range Cargo.lock already resolves to (0.4.29).
Neither is meant for crates.io, and crates.io already has an unrelated
uniffi-bindgen. The release plan publishes every workspace crate that
does not set publish = false.
publish-crates.yml takes the crates to release, in dependency order, and
runs the checks of the tag-triggered release.yml on all of them:
changelog, semver, tests. It then runs one multi-package cargo publish,
which in a dry run packages each crate and builds it against the
others' packages through a local registry overlay, so the dry run
passes before any of them is on crates.io. The old dry run never ran
cargo publish at all.

A real run skips versions crates.io already has, uploads the rest and
creates a <crate>-vX.Y.Z GitHub release for each.
python.yml no longer publishes on gl-client-py-v* and gl-sdk-v* tags.
release.yml calls it with the packages to publish and a dry-run flag.
Both modes check that each file carries the version from pyproject.toml
and that twine accepts the metadata. The dry run stops there, outside
the pypi environment, so it needs no approval.

The concurrency group names the workflow itself: a called workflow sees
the caller's github.workflow, and the workflows release.yml calls would
share a group and cancel each other.
typescript.yml published on every push to main whose version npm did
not have yet. It now always builds and tests, and publishes only when
release.yml calls it, or runs `npm publish --dry-run` for a dry run.
Every Swift build checks out gl-sdk-swift's main and runs its
scripts/prepare.sh and scripts/check-package.sh against the fresh
XCFramework, instead of an inline copy of its Package.swift. A template
change there that does not fit the build fails here first.

A real release, called from release.yml, attaches the assets to the
gl-sdk-vX.Y.Z release, waits for gl-sdk-swift to tag X.Y.Z and verifies
it with scripts/verify.sh, so the Swift release shows on this
repository's Actions page.
Actions > Release > Run workflow now releases the crates, both Python
packages, npm, Swift and Maven, replacing the per-crate tag trigger.
Its plan step reads each version from the repository, asks the registry
whether it is published and writes the plan to the run summary. A real
release, from main only, publishes what is missing, crates first, then
the bindings in parallel. A dry run, the default, exercises every
selected artifact up to the upload, from any branch.

The plan also fails on wildcard dependency requirements, which crates.io
only rejects on upload, and on bindings whose versions disagree.
`./gradlew :lib:publishAllPublicationsToBundleRepository` writes the
publications in the Maven repository layout with checksums, unsigned,
like Maven Local. GitHub builds it for a release, and the internal
GitLab mirror signs and uploads it.
kotlin.yml, called by release.yml, builds the publications as an
unsigned bundle in the Maven repository layout and runs it through
contrib/maven-central/check-bundle.sh with a throwaway key: POM fields,
the md5 and sha1 checksums, every file signed and verified. A real
release attaches the bundle and its SHA-256 to the gl-sdk-vX.Y.Z
release, where Blockstream's release infrastructure picks it up, signs
it with Blockstream's key and uploads it, and waits until the version
is on repo1.maven.org. No Maven credentials are on GitHub.

It also ran on pushes to master, a branch this repository does not
have, and on gl-sdk-* tags; it now runs on main.
@cdecker
cdecker force-pushed the 2026m11-release-public branch from 7b797aa to d6d5034 Compare November 19, 2026 14:54
@cdecker cdecker changed the title ci: Publish every SDK artifact from GitHub on release tags ci: Release every SDK artifact from one Release workflow Nov 19, 2026
The internal GitLab mirror ran the Kotlin snapshots and the manual
Maven Central release from this tree. Releases are started from the
Release workflow here now, and the Maven Central upload happens outside
this repository, from the bundle the workflow attaches to the gl-sdk
release. Maven -SNAPSHOT builds are no longer published.
@cdecker
cdecker force-pushed the 2026m11-release-public branch from d6d5034 to 8fb8f33 Compare November 19, 2026 17:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant