fix(release): publish Flutter packages via pub.dev automated publishing - #42
Merged
Merged
Conversation
The Flutter release job had no pub.dev credential at all. `dart pub publish
--force` without one does not fail -- it prints an OAuth URL and blocks on
stdin, so the job hung until GitHub cancelled it at the 6h limit. That is why
authsome_core sits at 1.5.0 on pub.dev while authsome_flutter and
authsome_flutter_ui are stranded at 1.4.0: the run died before reaching them.
Replace the hand-rolled job with xraph/workflows' pub-publish.yml, which
authenticates over OIDC and publishes the three packages in dependency order,
skipping any version already on pub.dev so a partially failed release can be
re-run.
pub.dev matches the pushed tag against each `version:` in pubspec.yaml and
refuses the upload when they disagree, so versions can no longer be stamped
during the run. prepare-flutter-publish.sh is therefore replaced by
bump-flutter-version.sh, run before tagging with its result committed. Its two
other jobs are gone: `resolution: workspace` publishes fine and never needed
stripping, and the sleeps for pub.dev indexing were unnecessary because
workspace resolution resolves a sibling locally rather than from the registry.
Two latent bugs surfaced while verifying this against real pub.dev:
- `dart pub publish --dry-run` exits 65 on warnings, and none of the three
packages had a CHANGELOG.md, so validation would have failed even with
working credentials. Add one per package.
- authsome_flutter_ui depended on `authsome_flutter: ^0.1.0`, which caps at
<0.2.0 and could never resolve against a 1.x release. The old script masked
this by rewriting the constraint at publish time.
Versions are unified at 1.6.0 so a single v{{version}} tag pattern covers all
three, matching how the Go and npm artifacts already release.
Note that pub.dev only accepts automated publishing from a tag push, so
workflow_dispatch runs now force dry-run instead of failing at authorization.
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.
The Flutter release job never had a pub.dev credential.
dart pub publish --forcewithout one does not fail — it prints an OAuth URL and blocks on stdin, so the job hung until GitHub cancelled it at the 6h limit (run 31342247801 burned 6h00m40s on step 6, "Publish authsome_core").That is why
authsome_coresits at 1.5.0 on pub.dev whileauthsome_flutterandauthsome_flutter_uiare stranded at 1.4.0 — the run died before reaching them.What changed
The hand-rolled job is replaced by
xraph/workflows'pub-publish.yml@v1(xraph/workflows#2), which authenticates over OIDC and publishes the three packages in dependency order, skipping any version already on pub.dev so a partially failed release can be re-run.pub.dev matches the pushed tag against each
version:inpubspec.yamland refuses the upload when they disagree, so versions can no longer be stamped during the run.prepare-flutter-publish.shis replaced bybump-flutter-version.sh, run before tagging with its result committed. The old script's two other jobs are gone as unnecessary:resolution: workspacepublishes fine and never needed stripping.sleep 45calls for pub.dev indexing were pointless — workspace resolution resolves a sibling locally, not from the registry.Two latent bugs this surfaced
Both were found by running the publish loop against real pub.dev on a clean tree, and both would have broken the release even with working credentials:
dart pub publish --dry-runexits 65 on warnings, and none of the three packages had aCHANGELOG.md. Validation would have failed regardless of auth. One added per package.authsome_flutter_uidepended onauthsome_flutter: ^0.1.0, which caps at<0.2.0and could never resolve against a 1.x release. The old script masked this by rewriting the constraint at publish time.Versions are unified at 1.6.0 so a single
v{{version}}tag pattern covers all three, matching how the Go and npm artifacts already release.Verification
Cloned clean, committed the changes, ran the workflow's publish loop verbatim against real pub.dev in dry-run — all three packages exit 0.
actionlintclean (the one remainingrelease.ymlwarning is pre-existing, confirmed by re-running with these changes stashed).Before merging / releasing
authsome_core,authsome_flutter,authsome_flutter_ui): Admin → Automated publishing → GitHub Actions, repoxraph/authsome, tag patternv{{version}}.mainbefore taggingv1.6.0— the tag has to point at a commit whose pubspecs already read1.6.0.Note that pub.dev only accepts automated publishing from a tag push, so
workflow_dispatchruns now force dry-run instead of failing at authorization. That makes dispatch a safe rehearsal.🤖 Generated with Claude Code