Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Adds first PyPI publishing workflow #51

Merged
merged 30 commits into from
Feb 14, 2024
Merged

Conversation

binaryaaron
Copy link
Contributor

@binaryaaron binaryaaron commented Feb 13, 2024

Adding in the proper GH action file to handle both

  • pypi releases (test and prod)
  • GH releases (draft and real)

The test path should get triggered on PRs to main; the others will only get triggered if we add a tag.

@binaryaaron binaryaaron marked this pull request as ready for review February 14, 2024 19:00
@sfriedowitz
Copy link
Contributor

sfriedowitz commented Feb 14, 2024

Why are these jobs running as part of the PR checks? It seems like the triggers might be incorrect if this is supposed to only run on publishes to main or GH releases?

Co-authored-by: Sean Friedowitz <[email protected]>
Signed-off-by: Aaron Gonzales <[email protected]>
@binaryaaron
Copy link
Contributor Author

Why are these jobs running as part of the PR checks? It seems like the triggers might be incorrect if this is supposed to only run on publishes to main or GH releases?

Only the draft ones are done when there is a tag. so this should not run if you make a tag-less PR against main.

can basically have a branch like "dev-0.2.0" and when it's ready to release, make a PR against main with a tag v0.2.0, which will then trigger this. after actual changes are landed, the non-draft version should run from main, and push the wheels to real pypi.

@veekaybee
Copy link
Member

Could you add some instructions in contributing around this and how to add a tag, i.e. is this a git tag? @binaryaaron

can basically have a branch like "dev-0.2.0" and when it's ready to release, make a PR against main with a tag v0.2.0, which will then trigger this. after actual changes are landed, the non-draft version should run from main, and push the wheels to real pypi.

@@ -0,0 +1,94 @@
# Build and publish to PyPI
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Build and publish to PyPI
name: Build and publish to PyPI

Should name the workflow a as a whole, or else it displays weird in the PR checks

@sfriedowitz
Copy link
Contributor

sfriedowitz commented Feb 14, 2024

I'm a bit confused by the release process here, my thought was that we would create a GH Release with a newly created tag based off the main branch, and that would trigger the publishing actions to real pypi.

I'm fine to go with this to give this system a shot, though. We can always tweak down the line if the triggers are not exactly as we'd expect.

Edit: This is the release trigger I was thinking of (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)

@binaryaaron
Copy link
Contributor Author

I'm a bit confused by the release process here, my thought was that we would create a GH Release with a newly created tag based off the main branch, and that would trigger the publishing actions to real pypi.

I'm fine to go with this to give this system a shot, though. We can always tweak down the line if the triggers are not exactly as we'd expect.

Edit: This is the release trigger I was thinking of (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)

that'd be fine too! this is more automation than that; if it doesn't work happy to simplify it / create a better overall structure for using GHA.

I'll add docs, @veekaybee , ty for the reminder.

Copy link
Member

@veekaybee veekaybee left a comment

Choose a reason for hiding this comment

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

🚀🐍

Copy link
Contributor

@sfriedowitz sfriedowitz left a comment

Choose a reason for hiding this comment

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

committable suggestions for consistency in formatting of contributing guide


## Publishing (automated)

`.github/workflows/publish.yaml' contains the GitHub Action used to do releases and push wheels to PyPI.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`.github/workflows/publish.yaml' contains the GitHub Action used to do releases and push wheels to PyPI.
`.github/workflows/publish.yaml` contains the GitHub Action used to do releases and push wheels to PyPI.

Ticks were off, so was not displaying code style


`.github/workflows/publish.yaml' contains the GitHub Action used to do releases and push wheels to PyPI.

There are two subcases - draft/dev and the 'real' release.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
There are two subcases - draft/dev and the 'real' release.
There are two cases - 'draft' and the 'real' releases.


### Draft / Test releases

If a contributed opens a PR to `main` with a git version tag (e.g., `vX.Y.Z`) , the draft process will start which does the following:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If a contributed opens a PR to `main` with a git version tag (e.g., `vX.Y.Z`) , the draft process will start which does the following:
If a contributer opens a PR to `main` with a git version tag (e.g., `vX.Y.Z`) , the draft process will start which does the following:

- make a draft release on github.


this is to ensure the full process works before merging to main.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
this is to ensure the full process works before merging to main.
This is to ensure the full process works before merging to `main`.

There are two subcases - draft/dev and the 'real' release.


### Draft / Test releases
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Draft / Test releases
### Draft releases

this is to ensure the full process works before merging to main.


### Real release
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Real release
### Real releases

Comment on lines +155 to +159





Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

@binaryaaron
Copy link
Contributor Author

I'll add some followups after this one; i think using labels might be a little easier both from a user perspective and event filtering perspective.

@binaryaaron binaryaaron merged commit b852e59 into main Feb 14, 2024
5 checks passed
@binaryaaron binaryaaron deleted the agonzales/publish-pypi branch February 14, 2024 22:48
@binaryaaron binaryaaron changed the title testing pypi release test Adds first PyPI publishing workflow Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants