Skip to content

feat(swift-release): support pre-releases (rc), GitHub-only, no Jamf - #81

Merged
Yan Xue (yanxue06) merged 1 commit into
mainfrom
feat/swift-release-prerelease
May 23, 2026
Merged

feat(swift-release): support pre-releases (rc), GitHub-only, no Jamf#81
Yan Xue (yanxue06) merged 1 commit into
mainfrom
feat/swift-release-prerelease

Conversation

@yanxue06

@yanxue06 Yan Xue (yanxue06) commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Teaches swift-release.yml to cut pre-releases (release candidates), not just stable releases — bringing it to parity with typescript-service-release.yaml and rust-service-release.yaml, which already have this. The underlying blocks (generate-release-info, create-github-release) already supported prerelease; the Swift workflow just never wired it up.

Why

  • A Swift pkg release (e.g. macrocosm-astrolabe) ships to the Jamf production Mac fleet on every release. There was no way to cut a candidate build for testing without shipping it to everyone.
  • This adds a pre-release path that builds the .pkg, attaches it to a GitHub pre-release (vX.Y.Z-rc.N, flagged prerelease) for manual testing, and skips Jamf entirely.

Changes

Job Before After
check-labels hardcoded ["release"] configurable labels-to-check, default ["release","prerelease"]
prepare-release gated on release label gated on release or prerelease (label or forced input)
generate-release-info always stable passes prerelease-rc.N version suffix
github-release always a full release passes prerelease → GitHub pre-release flag
jamf-upload ran on every release skipped on pre-releases — rc never reaches the fleet

New inputs (mirroring TS/Rust): labels-to-check, prerelease (force), release (force).

Note on semantics

Here prerelease is a peer of release — either one alone triggers the pipeline. TS/Rust treat prerelease as a modifier that still requires the release label. This is a small ergonomic improvement (lets a caller cut an rc with one label / one toggle); it's a strict superset of the old behavior, so existing release-labeled flows are unchanged. Happy to align all three either way.

Compatibility

Backward compatible. Existing callers (only macrocosm-astrolabe today) keep working unchanged — a release-labeled merge still cuts a stable release + Jamf deploy.

Merge order

⚠️ The companion caller PR (macrocosm-astrolabe) passes the new release/prerelease inputs, which don't exist on @main until this merges. Merge this first, then the astrolabe PR.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Chores
    • Enhanced release workflow with configurable PR-label checking for validation
    • Expanded prerelease trigger conditions to support label-based and explicit input methods
    • Updated deployment process to prevent prerelease version uploads

Review Change Stack

swift-release.yml could only cut stable releases — it never passed the
`prerelease` flag the underlying blocks already support, and it deployed
to Jamf on every release. This brings it to parity with the TS/Rust
release workflows and adds a Jamf safety gate for pre-releases.

- add `labels-to-check`, `prerelease`, and `release` inputs (matching
  typescript-service-release / rust-service-release)
- `prerelease` is a peer of `release`: either label/input alone triggers
  the pipeline (small ergonomic improvement over the TS/Rust gating,
  which treats prerelease as a modifier requiring `release` too)
- thread `prerelease` into generate-release-info (-> -rc.N version) and
  create-github-release (-> GitHub pre-release flag)
- skip jamf-upload on pre-releases so an rc never ships to the fleet

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 22, 2026 21:46
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0bee700e-264a-4fef-9dcf-a991c0d6b72a

📥 Commits

Reviewing files that changed from the base of the PR and between cc21656 and 711a730.

📒 Files selected for processing (1)
  • .github/workflows/swift-release.yml
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: copilot-pull-request-reviewer
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-04-05T00:07:12.194Z
Learnt from: qwerzl
Repo: photon-hq/buildspace PR: 62
File: .github/workflows/update-docs.yaml:164-167
Timestamp: 2026-04-05T00:07:12.194Z
Learning: In this repo (photon-hq/buildspace), reusable workflow blocks referenced under photon-hq/buildspace (e.g., `photon-hq/buildspace/.github/blocks/<block>main`) are intentionally pinned to `main` because the blocks and workflows ship together and are kept in sync. During review, do not flag these references as version-pinning/supply-chain issues just because they use `main`; only require pinning to a release tag if there’s a separate reason (e.g., referencing an external repo or a non-controlled branch).

Applied to files:

  • .github/workflows/swift-release.yml
📚 Learning: 2026-04-27T01:30:22.893Z
Learnt from: yanxue06
Repo: photon-hq/buildspace PR: 73
File: .github/workflows/check-readme.yaml:18-18
Timestamp: 2026-04-27T01:30:22.893Z
Learning: When reviewing this repo’s GitHub Actions workflows, treat Blacksmith runner labels like `blacksmith-4vcpu-ubuntu-2404` and other `blacksmith-*vcpu-ubuntu-*` values as valid/intentional third-party runner labels (Blacksmith: blacksmith.sh). Do not flag them as unknown or non-standard runner labels—these are an intentional drop-in replacement for GitHub-hosted runners.

Applied to files:

  • .github/workflows/swift-release.yml
📚 Learning: 2026-04-27T01:30:22.893Z
Learnt from: yanxue06
Repo: photon-hq/buildspace PR: 73
File: .github/workflows/check-readme.yaml:18-18
Timestamp: 2026-04-27T01:30:22.893Z
Learning: In photon-hq/buildspace GitHub workflow YAML files, runner labels that match `blacksmith-*vcpu-ubuntu-*` (e.g., `blacksmith-4vcpu-ubuntu-2404`) are intentionally managed by the Blacksmith CI service (blacksmith.sh) and serve as drop-in replacements for GitHub-hosted ephemeral microVM runners. Do not flag these labels as unknown/non-standard, supply-chain concerns, or “unrecognized runner” issues; any linter/actionlint warnings about these specific labels are expected false positives.

Applied to files:

  • .github/workflows/swift-release.yml
🔇 Additional comments (6)
.github/workflows/swift-release.yml (6)

26-40: LGTM!


84-84: LGTM!


88-95: LGTM!


111-111: LGTM!


145-145: LGTM!

Also applies to: 156-156


159-165: LGTM!


📝 Walkthrough

Walkthrough

This PR extends the Swift release workflow with configurable PR-label checking. A new labels-to-check input allows custom label selection, while the prepare-release trigger is broadened to activate on either label-derived release states or forced inputs. The computed prerelease value flows through release-info generation and job dependencies, ultimately gating Jamf uploads to prevent prerelease builds from being deployed.

Changes

Prerelease Configuration and Workflow Gating

Layer / File(s) Summary
Workflow inputs and documentation
.github/workflows/swift-release.yml
New labels-to-check input (JSON array, defaulting to ["release", "prerelease"]) and clarified prerelease/release input descriptions to document forced behavior and Jamf upload skipping.
Release preparation trigger and label checking
.github/workflows/swift-release.yml
check-labels job now consumes labels-to-check input; prepare-release job condition expanded to trigger on label-derived release/prerelease state or forced input overrides.
Prerelease flag propagation and job dependencies
.github/workflows/swift-release.yml
Computed prerelease boolean passed to release-info generation with fallback to label-derived value; github-release job now depends on check-labels to access label data.
Release creation and Jamf upload gating
.github/workflows/swift-release.yml
GitHub release step passes computed prerelease flag; jamf-upload job adds condition to skip upload when release is prerelease (either forced or label-derived).

🐰 A workflow takes shape with care,
Labels checked and flags declared,
Prerelease builds now know their fate,
Jamf uploads won't propagate,
Release dance complete and fair! 🚀

🎯 2 (Simple) | ⏱️ ~12 minutes

release

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding pre-release (rc) support to the swift-release workflow with GitHub-only deployment (skipping Jamf for pre-releases).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/swift-release-prerelease

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

📄 README may need an update

This PR introduces changes that might not be reflected in README.md.

Reason: The Swift Release README section is missing newly supported workflow inputs and behavior in .github/workflows/swift-release.yml, including payload-path, resource-bundles, release/prerelease controls, label overrides, and use-blacksmith.

This is an automated check powered by AI. If the README is intentionally unchanged, feel free to ignore this.

@github-actions

Copy link
Copy Markdown

📚 Skills documentation may need an update

This PR introduces changes that might not be reflected in the skills documentation.

Reason: _skills-repo/skills/buildspace-ci-cd/SKILL.md is outdated because swift-release.yml now supports prerelease flows and additional public inputs like labels-to-check, prerelease, release, resource-bundles, and use-blacksmith, while the skill still says Swift releases only check the release label and omits those options.

This is an automated check powered by AI. If the skills are intentionally unchanged, feel free to ignore this.

@coderabbitai coderabbitai Bot added the release label May 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@yanxue06
Yan Xue (yanxue06) merged commit 15ee35b into main May 23, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants