Skip to content

[FSSDK-13238] ci: publish releases automatically when SDKVersion.swift changes - #659

Merged
muzahidul-opti merged 4 commits into
masterfrom
muzahid/spm-release-workflow
Oct 7, 2026
Merged

muzahidul-opti merged 4 commits into
masterfrom
muzahid/spm-release-workflow

Conversation

@muzahidul-opti

@muzahidul-opti muzahidul-opti commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Replaces the manual PREP/RELEASE workflow_dispatch jobs (hub scripts on macOS runners, version in swift.yml) with a release that publishes on merge. SDKVersion.swift is the single source of the version — it's what the SDK reports at runtime (client_version, OptimizelyClient.version), so the tag can't drift from it.

- edit VERSION in swift.yml → PR → run PREP=true → merge bot PR → run RELEASE=true
+ PR: bump SDKVersion.swift + CHANGELOG.md → merge → release.yml tags + publishes
release.yml  (push to master | release/**, paths: Sources/Utils/SDKVersion.swift)
  read OPTIMIZELYSDKVERSION
  tag vX.Y.Z exists?           → exit 0 (safe to re-run)
  CHANGELOG "## X.Y.Z" missing → fail, nothing tagged
  gh release create vX.Y.Z --target $GITHUB_SHA --notes-file <CHANGELOG section>
    -suffix version   → --prerelease
    from release/**   → --latest=false
  • swift.yml:
    • drop PREP/RELEASE inputs, VERSION env, per-job if: guards and the two release jobs
    • run CI on release/** too
    • skip integration_tests on manual runs (the ci-helper-tools trigger script rejects workflow_dispatch; the old guards used to skip it)
  • run_unit_tests.sh: remove the BRANCH == master guard, which made unit tests report success without running on any other branch.
  • Delete run_prep.sh, run_release.sh, update_version.sh, build_all.sh (only used by prep).
  • Docs:

Test plan

Publish script run locally against the repo:

  • Existing tag: version 5.5.0 → tag exists -> skip
  • Notes extraction: ## 5.5.0 → 8 lines, ## 5.4.2 → 9 lines, ## 9.9.9 → 0 lines (job fails)
  • Flags:
    5.6.0      on master        → (none)
    5.6.0      on release/5.4.x → --latest=false
    5.6.0-beta on master        → --prerelease
    5.6.0-beta on release/5.4.x → --prerelease --latest=false
    
  • actionlint clean on release.yml.
  • Repo settings: checked that no tag rulesets block GITHUB_TOKEN from creating v* tags. The only rulesets are branch rules (force-push, Arnica).
  • Not yet run end-to-end: the publish step runs on the next real release merge. A personal-fork dry run is possible before that.

Merge Danger

Door: two-way. Reverting restores the old jobs and scripts. Once immutable releases are enabled, a published tag can't be moved or reused.
Blast Radius:

  • Any merged change to SDKVersion.swift on master/release/** now publishes a release.
  • Manual PREP/RELEASE runs no longer exist.
  • Unit tests now run for PRs into release/** (previously skipped).
  • Recommended settings after merge: branch protection for release/**, immutable releases.

Issues

  • FSSDK-13238

🤖 Generated with Claude Code

Replace the manual PREP/RELEASE workflow_dispatch jobs (hub-based
run_prep.sh / run_release.sh on macOS runners) with release.yml, which
tags vX.Y.Z and publishes the GitHub release on merge to master or
release/**. SDKVersion.swift is the single source of the version.

Also run unit tests for release/** PRs; run_unit_tests.sh previously
skipped them silently on any branch other than master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
muzahidul-opti and others added 3 commits October 6, 2026 23:22
The ci-helper-tools trigger script rejects workflow_dispatch events; the
removed PREP/RELEASE guards used to skip this job on manual runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The only versioned line was the CocoaPods install snippet, removed in #658.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.929%. remained the same — muzahid/spm-release-workflow into master

@jaeopt jaeopt 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.

LGTM

@datadog-optimizely-experimentation

This comment has been minimized.

@muzahidul-opti
muzahidul-opti merged commit 8fc2f26 into master Oct 7, 2026
16 of 19 checks passed
@muzahidul-opti
muzahidul-opti deleted the muzahid/spm-release-workflow branch October 7, 2026 00:59
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.

3 participants