Skip to content

Provide a publish command hook, to ensure that no release is actually created if either the push or the publish fail #359

Closed
@dead-claudia

Description

@dead-claudia

Related: MithrilJS/mithril.js#2987

TL;DR: I'm running into pain with releases being cut prematurely if it fails to successfully be published. Ideally, we'd be following this flow, aborting the whole process if any step fails:

  1. Bump version, commit, and create new tag per pr-release.
  2. Push new tag per pr-release.
  3. Push (in our case, force-push) release branch.
  4. Do npm publish.
  5. Finally, create a release on GitHub.

Unfortunately, the current design of pr-release forces us into this flow:

  1. Bump version, commit, and create new tag per pr-release.
  2. Push new tag per pr-release.
  3. Create a release on GitHub.
  4. Push (in our case, force-push) release branch.
  5. Do npm publish.

1 through 3 are wrapped up into a single command, so we can't move the release creation to after the npm publish without moving the version bump ahead of it as well. And moving the version bump ahead of the publish means the version isn't bumped before publishing, and this will obviously cause the npm publish to fail due to the version already existing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions