Skip to content

Commit 222ce2c

Browse files
committed
Update to use trusted publisher on pypi
1 parent 8ed4f79 commit 222ce2c

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,32 @@ on:
55
types: [created]
66

77
jobs:
8-
deploy:
8+
publish:
99
runs-on: ubuntu-latest
10+
# Specifying a GitHub environment is optional, but strongly encouraged
11+
environment: release
12+
permissions:
13+
# IMPORTANT: this permission is mandatory for trusted publishing
14+
id-token: write
15+
1016
steps:
1117
- uses: actions/checkout@v5
18+
1219
- name: Set up Python
1320
uses: actions/setup-python@v6
1421
with:
1522
python-version: "3.x"
23+
1624
- name: Install dependencies
1725
run: |
1826
python -m pip install --upgrade pip
19-
pip install build twine
20-
- name: Build and publish
21-
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24-
run: |
25-
make release
27+
pip install build
28+
29+
- name: Build package distributions
30+
run: make sdist
31+
32+
- name: Publish package distributions to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1
2634

2735
- name: Publish Documentation
2836
run: |

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ clean-pyc:
1212
find . -name '*.pyo' -exec rm -f {} +
1313
find . -name '*~' -exec rm -f {} +
1414

15-
release: sdist
16-
twine check dist/*
17-
twine upload dist/*
18-
19-
release-test: sdist
20-
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
21-
2215
sdist: clean
2316
python -m build -o dist .
2417
ls -l dist

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pytest-cov
55
pytest>=3.9
66
sh>=2
77
tox
8-
twine
98
wheel
109
ruff
10+
build
1111
pre-commit

0 commit comments

Comments
 (0)