Skip to content

Commit 7730ea1

Browse files
ci(release): Use PyPI's trusted publisher (#149)
Signed-off-by: AlexNg <[email protected]>
1 parent 7ce035d commit 7730ea1

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,31 @@ jobs:
1212
pypi-publish:
1313
name: Upload release to PyPI
1414
runs-on: ubuntu-latest
15+
environment:
16+
name: release
17+
url: https://pypi.org/project/thread
18+
permissions:
19+
id-token: write
1520

1621
steps:
17-
- uses: actions/checkout@v4
18-
- name: Build and publish
19-
uses: JRubics/[email protected]
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python 3.x
26+
uses: actions/setup-python@v5
2027
with:
21-
pypi_token: ${{ secrets.PYPI_TOKEN }}
28+
python-version: 3.x
29+
30+
- name: Install dependencies
31+
run: |
32+
set -xe
33+
python -m pip install poetry
34+
python -m poetry install
35+
36+
- name: Build Thread
37+
run: |
38+
set -xe
39+
python -m poetry build
40+
41+
- name: Publish to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)