Skip to content

feat(pub-publish): add a reusable pub.dev publish workflow - #2

Merged
juicycleff merged 1 commit into
mainfrom
feat/pub-publish
Aug 11, 2026
Merged

feat(pub-publish): add a reusable pub.dev publish workflow#2
juicycleff merged 1 commit into
mainfrom
feat/pub-publish

Conversation

@juicycleff

Copy link
Copy Markdown
Contributor

Adds pub-publish.yml, an ordered multi-package pub.dev publish workflow authenticating via OIDC.

Why not call dart-lang/setup-dart/.github/workflows/publish.yml

That workflow takes a single working-directory, so a repo publishing a core package plus dependents needs one job per package with no ordering between them. It has no dry-run, and its inputs are fixed, so a caller cannot wrap it to add one. This is the same reasoning recorded in npm-publish.yml.

Notes

  • Auth is OIDC, nothing is passed in. pub.dev honours it only when the run was triggered by pushing a tag matching the pattern configured under Admin → Automated publishing, and each version: in pubspec.yaml must equal the tag version. Hence no version input — stamping one would produce an archive pub.dev then refuses.
  • Already-published versions are skipped, so a partially failed release can be re-run.
  • Dart SDK is set up first (it provisions the credential), then Flutter, whose bundled dart shadows it — only that binary resolves sdk: flutter deps, and it publishes pure-Dart packages too.
  • dry-run defaults to true: a pub.dev version can only be retracted for 7 days and the name is never freed.

Verification

actionlint clean. The publish loop was run verbatim against real pub.dev in dry-run over the three xraph/authsome Flutter packages on a clean tree — all three exit 0.

Publishes one or more Dart/Flutter packages to pub.dev from a single job in a
caller-supplied order, authenticating with OIDC rather than a stored credential.

dart-lang/setup-dart's publish.yml takes a single working-directory, so a
repository publishing a core package plus dependents needs one job per package
and gets no ordering between them. It also has no dry-run and its inputs are
fixed, so a caller cannot wrap it to add one. Same reasoning as npm-publish.yml.

Versions already on pub.dev are skipped rather than treated as an error, so a
release whose later packages failed can be re-run without dying on the ones that
already succeeded.
@juicycleff
juicycleff merged commit 86abd01 into main Aug 11, 2026
38 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.

1 participant