Skip to content

Commit b443a17

Browse files
committed
CI: Update to trusted publisher workflow
1 parent 9c0a80f commit b443a17

1 file changed

Lines changed: 29 additions & 17 deletions

File tree

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI
1+
name: Publish to PyPI
22

33
on:
44
release:
5-
types: [created]
5+
types: [published]
66

77
jobs:
8-
build-n-publish:
9-
name: Build and publish Python 🐍 distributions 📦 to PyPI
8+
pypi-publish:
9+
name: Upload release to PyPI
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/subscript
14+
permissions:
15+
id-token: write
16+
1117
steps:
12-
- uses: actions/checkout@master
13-
- name: Set up Python 3.8
14-
uses: actions/setup-python@v1
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Python 3.11
24+
uses: actions/setup-python@v5
1525
with:
16-
python-version: 3.8
17-
- name: Install dependencies
18-
run: pip install --upgrade setuptools wheel twine
19-
- name: Build package
20-
run: python setup.py sdist bdist_wheel
21-
- name: Upload deploy
22-
env:
23-
TWINE_USERNAME: __token__
24-
TWINE_PASSWORD: ${{ secrets.PYPI_SECRET }}
25-
run: python -m twine upload dist/*
26+
python-version: 3.11
27+
28+
- name: Install build dependencies
29+
run: |
30+
pip install -U pip
31+
pip install build
32+
33+
- name: Build distributions
34+
run: python -m build
35+
36+
- name: Publish package distributions to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)