Skip to content

Conversation

@eriknw
Copy link
Contributor

@eriknw eriknw commented Dec 2, 2025

Closes #22.

This uses Trusted Publishing, which needs set up on PyPI and GitHub, which I believe currently needs done by e.g. @stefanv or @jarrodmillman. (Alternatively, I could be added and/or given permission to do this--I have no preference).

Feel free to suggest or update the if: condition for when to upload, as this should probably be done by the release manager and closely match the release process.

Note that I identified two GitHub environments: test-pypi and pypi.

I also updated pre-commit hooks, and made a few changes to make Zizmor pre-commit a little more happy.

Finally, I think it would be nice to upload a release to PyPI, since we are technically name-squatting and could lose it no PyPI without notice. I would do a pre-release first to test the GitHub action.

Comment on lines 135 to 139
# TODO: get zizmor to pass, and maybe set it up as a github action
# - repo: https://github.com/woodruffw/zizmor-pre-commit
# rev: v1.11.0
# rev: v1.18.0
# hooks:
# - id: zizmor
Copy link
Member

Choose a reason for hiding this comment

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

I know that this is outside the scope of setting up a publishing action, but I wanted to note that this is a TODO lying around outside the diff of this PR, and it'll help secure the publishing process when resolved. So it might make sense to resolve this here itself.

A pre-commit hook is better than an action here, as it'll run in the pre-commit checks job, and you'd avoid adding another action this way.

Comment on lines +9 to +11
permissions:
contents: read

Copy link
Member

Choose a reason for hiding this comment

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

These permissions can go down into the context of the job, and then this can simply be:

Suggested change
permissions:
contents: read
permissions: {}

so that the permissions are more granularly divided/scoped.

Comment on lines +11 to +12
permissions:
contents: read
Copy link
Member

Choose a reason for hiding this comment

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

Same as above:

Suggested change
permissions:
contents: read
permissions: {}

Comment on lines +15 to +19
build-artifacts:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
build-artifacts:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
build-artifacts:
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
shell: bash -l {0}

@jarrodmillman jarrodmillman self-requested a review December 2, 2025 18:21
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.

Set up PyPI Trusted Publishing with Github Actions (or add PyPI maintainers)

2 participants