Skip to content

Commit 2ee2448

Browse files
Update python-publish.yml
1 parent 4571a57 commit 2ee2448

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

.github/workflows/python-publish.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# This workflow will upload a Python Package to PyPI 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-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
91
name: Upload Python Package
102

113
on:
@@ -14,6 +6,7 @@ on:
146

157
permissions:
168
contents: read
9+
id-token: write # needed for pypi publish action
1710

1811
jobs:
1912
release-build:
@@ -24,47 +17,42 @@ jobs:
2417

2518
- uses: actions/setup-python@v5
2619
with:
27-
python-version: "3.x"
20+
python-version: "3.10" # update as needed
2821

29-
- name: Build release distributions
22+
- name: Install build dependencies
3023
run: |
31-
# NOTE: put your own distribution build steps here.
24+
python -m pip install --upgrade pip
3225
python -m pip install build
33-
python -m build
3426
35-
- name: Upload distributions
27+
- name: Build release distributions
28+
run: python -m build
29+
30+
- name: Upload distributions artifact
3631
uses: actions/upload-artifact@v4
3732
with:
3833
name: release-dists
3934
path: dist/
4035

4136
pypi-publish:
4237
runs-on: ubuntu-latest
43-
needs:
44-
- release-build
38+
needs: release-build
4539
permissions:
46-
# IMPORTANT: this permission is mandatory for trusted publishing
4740
id-token: write
4841

49-
# Dedicated environments with protections for publishing are strongly recommended.
50-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
5142
environment:
5243
name: pypi
53-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54-
# url: https://pypi.org/p/YOURPROJECT
55-
#
56-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57-
# ALTERNATIVE: exactly, uncomment the following line instead:
58-
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
44+
url: https://pypi.org/project/extliner
5945

6046
steps:
61-
- name: Retrieve release distributions
47+
- name: Download release distributions
6248
uses: actions/download-artifact@v4
6349
with:
6450
name: release-dists
6551
path: dist/
6652

67-
- name: Publish release distributions to PyPI
53+
- name: Publish to PyPI
6854
uses: pypa/gh-action-pypi-publish@release/v1
6955
with:
7056
packages-dir: dist/
57+
env:
58+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)