Skip to content

Commit 04967e4

Browse files
authored
Merge pull request #106 from ikalnytskyi/chore/gh-action-pypi-publish
Use PyPI's trusted publishing
2 parents 5f5a308 + 35b5068 commit 04967e4

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/cd.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,27 @@ on:
88
jobs:
99
pypi:
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/project/picobox/${{ github.ref_name }}/
14+
permissions:
15+
id-token: write
1116
steps:
1217
- name: Checkout
1318
uses: actions/checkout@v4
1419

15-
- name: Prepare artifacts
16-
run: |
17-
pipx run -- hatch build
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.13"
24+
25+
- name: Setup build dependencies
26+
run: pip install build
27+
28+
- name: Build package
29+
run: python -m build
1830

1931
- name: Publish to PyPI
20-
env:
21-
TWINE_USERNAME: __token__
22-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
23-
run: |
24-
pipx run -- twine upload dist/*
32+
uses: pypa/gh-action-pypi-publish@93e87954aa8d40d7467c30656ba421aee00d37c8
33+
with:
34+
print-hash: true

0 commit comments

Comments
 (0)