Skip to content

chore: Add release workflows for automated pub.dev publishing#62

Merged
rmi22186 merged 15 commits intomainfrom
feature/release-workflows
Apr 2, 2026
Merged

chore: Add release workflows for automated pub.dev publishing#62
rmi22186 merged 15 commits intomainfrom
feature/release-workflows

Conversation

@rmi22186
Copy link
Copy Markdown
Member

@rmi22186 rmi22186 commented Apr 1, 2026

Background

  • The mParticle Flutter SDK has had no automated release process — releases and pub.dev publishing have been manual. The ROKT Flutter SDK (rokt-sdk-flutter) has a well-established release workflow pattern that we want to adopt for consistency across Flutter SDKs.
  • The existing iOS CI build was also broken due to GitHub removing the iOS 18.4 simulator runtime from macos-15 runner images in January 2026, causing Xcode 16.3 builds to fail.

What Has Changed

  • Release workflows: Added two new GitHub Actions workflows following the ROKT pattern:
    • draft-release-publish.yml — manually triggered workflow that bumps the version (major/minor/patch), updates VERSION, pubspec.yaml, and CHANGELOG.md, runs a dry-run publish, and creates a release PR targeting main
    • release-from-main.yml — triggers automatically when VERSION changes on main, runs tests, builds Android and iOS, publishes to pub.dev via OIDC trusted publishing (no stored credentials), creates a v{version} git tag, and creates a GitHub release with changelog notes
  • VERSION file: Added VERSION file (1.1.1) as the single source of truth for the SDK version
  • CHANGELOG.md: Reformatted to Keep a Changelog format, required by the thomaseizinger/keep-a-changelog-new-release action used in the draft workflow
  • Pub.dev OIDC publishing: Configured trusted publishing on pub.dev for mParticle/mparticle-flutter-sdk with tag pattern v{{version}} — no PUB_DEV_* secrets required
  • Historical tags: Backfilled missing version tags (v0.2.0-alpha.1 through v1.1.1) on historical commits
  • iOS CI fix: Removed the Xcode 16.3 version pin from pull-request.yml — the macos-15 runner now defaults to Xcode 16.4 with iOS 18.5 pre-installed. Also switched to using xcodebuild directly with CODE_SIGN_IDENTITY="", CODE_SIGNING_REQUIRED=NO, and CODE_SIGNING_ALLOWED=NO to reliably skip codesigning in CI.

Screenshots/Video

  • N/A — workflow and CI changes only

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • The FLUTTER_VERSION repo variable must be set (e.g., 3.19.3) for the new release workflows to pick up the correct Flutter SDK version
  • The existing pull-request.yml still uses a hardcoded FLUTTER_SDK_VERSION env var — this could be migrated to vars.FLUTTER_VERSION in a follow-up
  • A main branch is required as the release target branch

Reference Issue (For employees only. Ignore if you are an outside contributor)

  • N/A

rmi22186 and others added 2 commits April 1, 2026 14:54
Add draft-release-publish and release-from-main GitHub Actions workflows
for automated pub.dev publishing via OIDC. Reformat CHANGELOG.md to
Keep a Changelog format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 1, 2026

PR Summary

Medium Risk
Moderate risk because it introduces new GitHub Actions workflows that can publish to pub.dev, create tags, and write releases; misconfiguration could break CI or trigger unintended releases, but no runtime SDK code changes are included.

Overview
Adds a modular CI pipeline by extracting test, build-android, build-ios, and build-web into reusable workflow_call workflows and updating pull-request.yml to call them with concurrency cancellation.

Introduces an automated release process: release-draft.yml bumps semver from VERSION, updates CHANGELOG.md/pubspec.yaml, runs flutter pub publish --dry-run, and opens a release PR; release-tag.yml tags main when VERSION changes; release-publish.yml publishes to pub.dev on v* tags (OIDC enabled), then creates a GitHub release from extracted changelog notes.

Standardizes versioning by adding a VERSION file and reformatting CHANGELOG.md to Keep a Changelog, and updates iOS build steps to use Xcode 16.4 with explicit no-codesign xcodebuild.

Written by Cursor Bugbot for commit 2e78147. This will update automatically on new commits. Configure here.

@rmi22186 rmi22186 requested review from a team and thomson-t April 1, 2026 19:08
rmi22186 and others added 5 commits April 1, 2026 15:31
flutter build ipa requires a Development Team even with --no-codesign,
causing CI failures. Switch to flutter build ios --no-codesign which
builds without requiring provisioning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Device builds require a Development Team even with --no-codesign.
Switch to --simulator which skips codesigning entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simulator builds require the iOS runtime to be installed. Use device
build with CODE_SIGNING_ALLOWED=NO env var to skip codesigning
without needing simulator runtimes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Flutter's --no-codesign flag doesn't reliably disable codesigning on
newer Xcode versions. Use flutter build ios --config-only to generate
the Xcode project, then call xcodebuild directly with
CODE_SIGN_IDENTITY, CODE_SIGNING_REQUIRED, and CODE_SIGNING_ALLOWED
overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
macos-15 runners default to Xcode 16.4 with iOS 18.5 pre-installed.
Pinning to Xcode 16.3 required iOS 18.4 which was removed from the
runner image.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Split release into two workflows: create-release-tag.yml watches
  VERSION changes on main and pushes a v* tag; release-from-main.yml
  triggers on v* tag push so the OIDC token has ref_type=tag which
  pub.dev requires for trusted publishing
- Change cancel-in-progress to false on release workflow to prevent
  inconsistent state from mid-release cancellation
- Remove setup-and-version/release-and-tag job split in favor of
  simpler release job using github.ref_name for the tag
- Restore setup-xcode step in pull-request.yml pinned to 16.4

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
rmi22186 and others added 3 commits April 2, 2026 10:12
Use MP_SEMANTIC_RELEASE_BOT token instead of default GITHUB_TOKEN.
Tags pushed with GITHUB_TOKEN don't trigger other workflows, so
the bot token is required for the release workflow to fire on tag push.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pin all third-party actions to exact commit SHAs to prevent
supply chain attacks from compromised action tags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- pull-request.yml: "Build and Test" → "Pull Request"
- draft-release-publish.yml → release-draft.yml: "Release – Draft"
- release-from-main.yml → release-publish.yml: "Release – Publish"
- create-release-tag.yml → release-tag.yml: "Release – Tag"
- Reorder bump-type options to patch, minor, major (most common first)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@nickolas-dimitrakas nickolas-dimitrakas left a comment

Choose a reason for hiding this comment

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

We should also separate out the pull-request.yml into pieces similar to how we have done in other repos (Ex: https://github.com/mParticle/mparticle-apple-sdk/blob/main/.github/workflows/pull-request.yml). But we can also do this in a separate PR.

Split monolithic pull-request.yml into reusable workflows:
- test.yml: Unit tests
- build-android.yml: Android APK and App Bundle builds
- build-ios.yml: iOS build with xcodebuild
- build-web.yml: Web build

Both pull-request.yml and release-publish.yml now reference these
reusable workflows, reducing duplication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
if [ ! -f build/web/flutter.js ]; then
echo "Web build not found!"
exit 1
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Web build check uses removed flutter.js file

Low Severity

The web build verification checks for build/web/flutter.js, but this file was removed in Flutter 3.22+ (replaced by flutter_bootstrap.js). The old workflow pinned Flutter to 3.19.3 where flutter.js existed; the new reusable workflow uses vars.FLUTTER_VERSION, so updating the Flutter version past 3.22 will cause this check to always fail. The example app's index.html also uses the pre-3.22 bootstrap pattern.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ignoring this since we're pinning to 3.19.3 int he FLUTTER_VERSION. Rather than change this and make more fixes, I'd prefer to update this in the future to get this out and tested.
image

Add branches filter to prevent redundant CI runs on tag pushes.
Without this, release tag pushes via PAT trigger both the release
workflow (intended) and the full PR CI suite (wasteful).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Nickolas Dimitrakas <nickolas.dimitrakas@rokt.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

PRs created with GITHUB_TOKEN don't trigger CI workflows. Use
MP_SEMANTIC_RELEASE_BOT PAT so the release PR triggers the
pull-request workflow for CI validation before merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rmi22186 rmi22186 merged commit 7013466 into main Apr 2, 2026
6 of 8 checks passed
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