dguest / pandamonium

Command line scripts to parse panda web api
BSD 3-Clause "New" or "Revised" License
27 stars 17 forks source link

fix: Don't run publishing workflow on tags to avoid errors #45

Closed matthewfeickert closed 4 years ago

matthewfeickert commented 4 years ago

(This is a port of https://github.com/scikit-hep/pylhe/pull/45)

With the old workflow if the publishing workflow was run after a new tag was created

$ bump2version <part>
$ git push origin master --tags

no release would get published to TestPyPI as the workflow that would get kicked off from the push event to master (and so NOT a tag event) would fail the "Verify untagged commits have dev versions" step

https://github.com/dguest/pandamonium/blob/3bcfd36525681fe56dc6dafee84a5f072533c833/.github/workflows/publish-package.yml#L37-L54

as it would

https://github.com/dguest/pandamonium/blob/3bcfd36525681fe56dc6dafee84a5f072533c833/.github/workflows/publish-package.yml#L38

but then also "${wheel_name}" != *"dev"* given that it comes from a tag. So nothing gets published.

Similarly, the workflow that would get kicked off from the tag event will just run though but will pass

https://github.com/dguest/pandamonium/blob/3bcfd36525681fe56dc6dafee84a5f072533c833/.github/workflows/publish-package.yml#L68-L74

as it is has github.ref of 'refs/tags/' and so nothing happens at all.

This PR fixes that by just letting pushes to master publish to TestPyPI and then letting the releases publish to PyPI.

Suggested squash and merge commit message:

* Don't run publishing workflow on tag events
   - Avoid publishing errors due to 'push' or 'tag' events and checks for tags
* Update pypa/gh-action-pypi-publish action to v1.4.1
matthewfeickert commented 4 years ago

@dguest This is ready for review.

matthewfeickert commented 4 years ago

@dguest Done making small text changes now, so this is really ready for review.

dguest commented 4 years ago

I like this because it removes code and apparently also fixes bugs