Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use trusted publishing for release #1142

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

bluetech
Copy link
Member

@bluetech bluetech commented Sep 2, 2024

See https://docs.pypi.org/trusted-publishers/. Loosely based on pytest CI.

@bluetech
Copy link
Member Author

bluetech commented Sep 2, 2024

We'll see if it works on release, might need fixups...

@bluetech bluetech merged commit c66f9d3 into pytest-dev:main Sep 2, 2024
16 checks passed
@bluetech bluetech deleted the trusted-publishing branch September 2, 2024 08:44
uses: hynek/build-and-inspect-python-package@2dbbf2b252d3a3c7cec7a810e3ed5983bd17b13a # v2.8.0

deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest-django'
Copy link
Member

Choose a reason for hiding this comment

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

FYI, there's a github.ref_name available now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure about github.ref_name but maybe github.ref_type is better for this?

path: dist

- name: Publish package
uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0
Copy link
Member

Choose a reason for hiding this comment

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

With this version, it's possible to opt in to uploading digital attestations, FYI.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will look into it for the next release

pip install --upgrade build

- name: Build package
run: python -m build
Copy link
Member

Choose a reason for hiding this comment

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

It's usually nice to keep it in the main workflow and put the job building the artifacts in front of the tests. Then, it'd be possible to test whatever's going to be uploaded, as opposed to building something new and potentially differing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, but I didn't want to complicate/slow down the test CI for now, but wanted to at least do it right for the deploy workflow.

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