Skip to content

ci: Fire publish workflows on prereleased events too#19

Merged
nawforce merged 1 commit into
mainfrom
ci-fire-publish-on-prereleased
May 17, 2026
Merged

ci: Fire publish workflows on prereleased events too#19
nawforce merged 1 commit into
mainfrom
ci-fire-publish-on-prereleased

Conversation

@kjonescertinia

Copy link
Copy Markdown
Contributor

Why

The release: types: [released] trigger only fires for non-prerelease GitHub releases. Cutting v2.0.0-beta.1 with gh release create --prerelease therefore fired the separate prereleased event, which neither workflow listened for — the publish had to be done via workflow_dispatch after the fact.

Change

Both PublishMaven.yml and PublishNPM.yml now listen for both released and prereleased:

on:
  release:
    types: [ released, prereleased ]
  workflow_dispatch:

The npm dist-tag routing added in #18 already distinguishes pre-releases (- in version) from stable versions, so this is safe — pre-releases continue to land under the beta dist-tag and won't clobber latest.

Test plan

  • Next pre-release tagged via gh release create <tag> --prerelease fires both publish workflows automatically (no manual dispatch required).
  • Stable release behaviour unchanged.

Note: apex-parser's workflows have the same gap. Worth a matching PR there before its first pre-release.

The `release: types: [released]` trigger only matches when a GitHub
release is published as non-prerelease. Creating a release with
`--prerelease` (e.g. v2.0.0-beta.1) fires the separate `prereleased`
event, so the publish workflows silently skipped and the artefacts
had to be pushed via workflow_dispatch.

Adding `prereleased` to the trigger list makes `gh release create
<tag> --prerelease` publish to npm and Maven Central without a
manual dispatch step. The npm dist-tag routing added in #18 already
distinguishes pre-releases from stable versions, so this is safe.
@nawforce
nawforce merged commit c7e09d5 into main May 17, 2026
1 check 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.

2 participants