Skip to content

Fix Upload Python Package workflow not triggering on programmatic releases#205

Merged
espenhgn merged 2 commits intomasterfrom
copilot/fix-python-publish-action
Apr 10, 2026
Merged

Fix Upload Python Package workflow not triggering on programmatic releases#205
espenhgn merged 2 commits intomasterfrom
copilot/fix-python-publish-action

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

GitHub Actions suppresses release: created events when the release is created by GITHUB_TOKEN, so python-publish.yml never fired after create-release.yml ran gh release create. This caused the v0.6.0 release to not be published to PyPI automatically.

Description

  • Added a deploy job to create-release.yml with the same build & publish steps as python-publish.yml
  • Job is gated on needs.release.outputs.released == 'true' — only runs when a new release is actually created (skips pushes where the tag already exists)
  • Added explicit permissions: contents: read to the deploy job (least-privilege)
  • python-publish.yml left unchanged — continues to handle manually-created releases via the UI

Flow for automated releases (via create-release.yml):

push to master
  └─ release job: detect version bump → create GitHub release (GITHUB_TOKEN)
       └─ deploy job [if released=true]: poetry build → twine → Test PyPI → PyPI

Flow for manual releases:

GitHub UI: create release
  └─ python-publish.yml (release: created): poetry build → twine → Test PyPI → PyPI

Related Issue

https://github.com/LFPy/LFPykit/issuespython-publish.yml had zero runs for v0.6.0 release.

Motivation and Context

GITHUB_TOKEN is explicitly prevented from triggering downstream workflow events in GitHub Actions. The release created by create-release.yml never cascades to python-publish.yml, so PyPI publish must be co-located in the same workflow.

How Has This Been Tested

Reviewed workflow logic and GitHub Actions event cascade behavior. The released output correctly propagates the check_tag result, ensuring the deploy job only runs on a genuine new release.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…lease creation

Agent-Logs-Url: https://github.com/LFPy/LFPykit/sessions/d9b292e6-eb74-46de-87fb-6c74e97b3ddd

Co-authored-by: espenhgn <2492641+espenhgn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix python-publish.yml action not triggering for release 0.6.0 Fix Upload Python Package workflow not triggering on programmatic releases Apr 10, 2026
Copilot AI requested a review from espenhgn April 10, 2026 10:13
@espenhgn espenhgn marked this pull request as ready for review April 10, 2026 10:17
@espenhgn espenhgn merged commit c07572a into master Apr 10, 2026
11 of 12 checks passed
@espenhgn espenhgn deleted the copilot/fix-python-publish-action branch April 10, 2026 10:18
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.

Upload Python Package python-publish.yml action didn't trigger

2 participants