ci(ios): publish tagged releases as binary targets via Buildkite#502
Draft
jkmassel wants to merge 1 commit into
Draft
ci(ios): publish tagged releases as binary targets via Buildkite#502jkmassel wants to merge 1 commit into
jkmassel wants to merge 1 commit into
Conversation
Mirrors the wordpress-rs tag-release flow. `bin/release.sh` stops at bumping versions on trunk; a follow-up Buildkite build kicked off with `NEW_VERSION=v<x.y.z>` then rewrites `Package.swift` to `.release(version:, checksum:)`, tags, and creates the GitHub Release. The tag's commit lives off trunk (parented on the release commit but only reachable via the tag ref), so SPM consumers pinning the tag resolve the prebuilt XCFramework from CDN rather than rebuilding from the local source bundle. This is the precondition for ignoring the committed iOS JS bundle at `ios/Sources/GutenbergKitResources/Gutenberg/` — once a tagged release exists in `.release(...)` mode and WordPress-iOS bumps to it, those files can be dropped from trunk.
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/502")Built from d8c20ad |
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.
Summary
bin/release.shstops at "bump versions on trunk and push" — no moregit tag, no moregh release create.:rocket: Publish Swift release $NEW_VERSIONBuildkite step, gated onbuild.env("NEW_VERSION") != null, takes over: builds + signs the XCFramework, uploads to S3, rewritesPackage.swiftto.release(version:, checksum:), tags, and creates the GitHub Release.release/validate/update_swift_package/publish_release_to_githublanes; tag's commit lives offtrunk, only the tag ref is pushed).Why
Tagged releases currently ship
Package.swiftin.localmode, so SPM consumers (WordPress-iOS pinsv0.15.0) resolve the JS bundle fromios/Sources/GutenbergKitResources/Gutenberg/— which is why those 61 files are still committed despite #495 wiring up XCFramework distribution for PR builds.Once a tag's
Package.swiftpoints at the prebuilt XCFramework on CDN (this PR), and WordPress-iOS bumps to a tag cut under the new flow, the committed iOS bundle and the two commented-out lines at.gitignore:200-202can finally be dropped.How a release works after this
Step 1 — local (same as today, minus the tag/release):
Bumps
package.json/GutenbergKitVersion.swift/GutenbergKitVersion.kt, runsmake build, commits aschore(release): X.Y.Z, pushes totrunk. Done.Step 2 — Buildkite:
trunkNEW_VERSION=vX.Y.ZThe new
:rocket:step:git_tag_exists+get_github_release).Package.swiftto.release(version: "vX.Y.Z", checksum: ...)(reusing therewrite_resources_mode!helper from ci(ios): publish + prune per-PR XCFramework snapshot branches #495).s3://a8c-apps-public-artifacts/gutenbergkit/vX.Y.Z/.release/vX.Y.Zbranch, commits the rewrite, tagsvX.Y.Z, pushes only the tag (push_git_tags, not the branch).gh release create vX.Y.Z --generate-noteswith the XCFramework + checksum as assets. Adds--prereleasewhen the version contains-.The tag's commit is parented on the release commit but unreachable from
trunk's history — same shape as thepr-build/<n>and (deferred)trunk-buildsnapshot branches, just published under a tag ref instead of a branch ref.Changes
Fastfile
fastlane/Fastfile: Four new lanes —release(orchestrator),validate,update_swift_package,publish_release_to_github. Reuses the existingrewrite_resources_mode!,required_version!,xcframework_checksum,xcframework_file_pathhelpers added in ci(ios): publish + prune per-PR XCFramework snapshot branches #495.Pipeline
.buildkite/pipeline.yml: New:rocket: Publish Swift release $NEW_VERSIONstep, gated onbuild.env("NEW_VERSION") != null. Existing:s3: Publish XCFramework to S3step also gated onNEW_VERSION == nullso the two don't double-upload..buildkite/release.sh(new): Sourcesuse-bot-for-git, downloads the xcframework + checksum artifacts frombuild-xcframework, runsbundle exec fastlane release version:$NEW_VERSION.Release script
bin/release.sh: Droppedcreate_tag,create_github_release,is_prerelease(unused), and theghdependency check. Push is nowgit push origin trunk(no--tags). Newprint_publish_instructionsprints the Buildkite trigger steps after the trunk push.Behavior change: prereleases now get a GitHub Release
Previously,
bin/release.shskippedgh release createfor prereleases (anything with a-suffix) — the tag was pushed but no GH Release existed. The new:rocket:flow does create a GH Release for prereleases, marked with--prerelease. This is intentional: every tag now has a corresponding Release page with the XCFramework + checksum attached, and consumers who previously pinned prerelease tags via Git revision can keep doing so.Docs
docs/releases.md: Rewrote into a Step 1 / Step 2 flow.docs/wordpress-app-integration.md: Updated two stale "make release creates the tag/GH release" lines.What's left for the JS bundle cleanup
v0.16.0) and confirm consumers resolve the binary target..gitignore:200-202andgit rmthe 61 files underios/Sources/GutenbergKitResources/Gutenberg/.Test plan
Most of this can only be exercised end-to-end by cutting an actual release, so most checkboxes won't flip until then.
Pipeline-only checks (pre-merge)
NEW_VERSION) hits the existing:s3:step and uploads undergutenbergkit/<commit-sha>/, same as today.:rocket:step.Publish PR XCFramework, not the new:rocket:step.Release dry-run (against a throwaway version)
trunkwithNEW_VERSION=v0.0.0-test.0. Confirm::rocket: Publish Swift release v0.0.0-test.0step runs.gutenbergkit/v0.0.0-test.0/.v0.0.0-test.0is created on the remote.Package.swift:9reads.release(version: "v0.0.0-test.0", checksum: ...).v0.0.0-test.0is created with--prereleaseand the xcframework attached.release/v0.0.0-test.0branch is pushed to the remote.:s3:step is skipped on the same build.swift package resolvedownloads the binary artifact from CDN; checksum validates.validatelane fails fast because the tag already exists.Cleanup after dry-run
Related
release/validate/update_swift_package/publish_release_to_githublanes.