Skip to content

chore: Trigger release.yml on published#222

Merged
AlbertDeFusco merged 3 commits into
mainfrom
chore/pre-release
Jan 29, 2026
Merged

chore: Trigger release.yml on published#222
AlbertDeFusco merged 3 commits into
mainfrom
chore/pre-release

Conversation

@AlbertDeFusco

Copy link
Copy Markdown
Collaborator

currently the release.yml workflow was triggered on push to main. Due to branch restrictions this can only happen on PR merge and Release through the UI.

on:
  push:
    branches:
      - main
    tags:
      - "v*"

What this PR does is respect the fact that we use the published event to push the tag to the repo. And by looking for github.event.release.prerelease we can selectively apply the --label=dev for upload to anaconda.org and avoid publishing pre-releases to pypi.

So in effect we would then be able to create pre-release from the main branch using the github UI after all appropriate PRs have been merged.

Comment thread .github/workflows/release.yml Outdated
# Only publish to PyPI if a tagged release
if: startsWith(github.event.ref, 'refs/tags/v')
# Only publish to PyPI for regular releases (not pre-releases, not main pushes)
if: github.event_name == 'release' && github.event.release.prerelease == false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is false supposed to be a string? I feel like I've had "bool-as-string" in github actions in the past ...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am giving this config a live run in another repo and I will specifically test this

@mattkram mattkram changed the title [chore] trigger release.yml on published chore: Trigger release.yml on published Jan 28, 2026
@AlbertDeFusco AlbertDeFusco added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit a8d089e Jan 29, 2026
41 of 43 checks passed
@AlbertDeFusco AlbertDeFusco deleted the chore/pre-release branch January 29, 2026 15:58
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