Skip to content

Commit 3a4f7bd

Browse files
A5rockswebknjaz
andauthored
Try out PyPI's trusted publishers (#2980)
* Create release.yml * Update documentation * Try out a seperate build * Add changelog entry * Fix formatting * I forgot that wheels aren't .zips * PR feedback Co-authored-by: webknjaz < webknjaz+github/[email protected] > --------- Co-authored-by: webknjaz <webknjaz+github/[email protected]>
1 parent 8e38a1e commit 3a4f7bd

3 files changed

Lines changed: 46 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
tags:
4+
- v*
5+
6+
# a lot of code taken from https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.8"
16+
- run: python -m pip install build
17+
- run: python -m build
18+
19+
- uses: actions/upload-artifact@v4
20+
with:
21+
name: trio-dist
22+
path: |
23+
dist/*.tar.gz
24+
dist/*.whl
25+
26+
pypi-publish:
27+
needs: [build]
28+
name: upload release to PyPI
29+
runs-on: ubuntu-latest
30+
environment:
31+
name: release
32+
url: https://pypi.org/project/trio
33+
permissions:
34+
id-token: write
35+
36+
steps:
37+
- uses: actions/download-artifact@v4
38+
with:
39+
pattern: trio-*
40+
path: dist
41+
merge-multiple: true
42+
43+
- name: Publish package distributions to PyPI
44+
uses: pypa/gh-action-pypi-publish@release/v1

docs/source/releasing.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ Things to do for releasing:
4141

4242
* tag with vVERSION, push tag on ``python-trio/trio`` (not on your personal repository)
4343

44-
* push to PyPI:
45-
46-
.. code-block::
47-
48-
git clean -xdf # maybe run 'git clean -xdn' first to see what it will delete
49-
python3 -m build
50-
twine upload dist/*
44+
* approve the release workflow's publish job
5145

5246
* update version number in the same pull request
5347

newsfragments/2980.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use PyPI's Trusted Publishers to make releases.

0 commit comments

Comments
 (0)