Skip to content

Commit cfd6f2b

Browse files
Switch to trusted publishing (#83)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 67e066f commit cfd6f2b

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,21 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
name: Upload Python Package
1+
name: Publish Python Package
52

63
on:
74
release:
85
types: [published]
96

10-
permissions:
11-
contents: read
12-
13-
env:
14-
PIP_ROOT_USER_ACTION: ignore
15-
167
jobs:
17-
deploy:
8+
publish:
189
runs-on: ubuntu-latest
19-
10+
environment: publish
11+
permissions:
12+
id-token: write # to authenticate as Trusted Publisher to pypi.org
2013
steps:
2114
- uses: actions/checkout@v3
22-
- name: Set up Python
23-
uses: actions/setup-python@v4
15+
- uses: actions/setup-python@v4
2416
with:
2517
python-version: "3.x"
2618
cache: "pip"
27-
cache-dependency-path: pyproject.toml
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip wheel
31-
pip install build
32-
- name: Build package
33-
run: python -m build
34-
- name: Publish package
35-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
36-
with:
37-
user: __token__
38-
password: ${{ secrets.PYPI_API_TOKEN }}
19+
- run: pip install build
20+
- run: python -m build
21+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)