Skip to content

Enable more automated workflows by allowing publishing from the workflow_dispatch trigger #7177

Closed
@spydon

Description

@spydon

Note: Pub.dev only allows automated publishing from GitHub Actions when the workflow is triggered by pushing a git tag to GitHub. Pub.dev rejects publishing from GitHub Actions triggered without a tag. This ensures that new versions cannot be published by events that should never trigger publishing.

I understand the reasoning here, but this also makes it impossible to do fully automated publishing since a tag that is created by another workflow isn't allowed to trigger other workflows. So with this restriction from pub.dev in place the publishing will always need manual intervention from the command-line/IDE, since a user has to push a tag manually to trigger the workflow.

What we would like is to trigger the workflow that publishes the new versions from another workflow by using the workflow_dispatch trigger (currently only push is allowed).

The simplest flow for our use-case would be this:

  1. The users goes to their action tab and presses "Run release action"
  2. The melos-action versions and creates changelogs for all packages, and then published a PR with the changes (it also checks if it gets any publish --dry-run warnings in this step)
  3. The PR is then reviewed
  4. When the PR is merged it triggers the melos publish job which will tag and publish all of newly versioned the packages.

For context this will for example be used by the melos-action that should semi-automate (PRs are still used) the whole publishing flow in monorepos, or any repositories using melos.

Design doc: https://flutter.dev/go/pub-automated-publishing

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions