Skip to content

Commit bee9070

Browse files
Update Python publish workflow for releases
Trigger workflow on published releases instead of created. Add permissions for id-token, specify environment, and update job naming for clarity. Remove explicit PyPI credentials in favor of improved security practices.
1 parent bb21671 commit bee9070

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/python-publish.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,34 @@ name: Upload Python Package
55

66
on:
77
release:
8-
types: [created]
8+
types: [published]
99

10-
jobs:
11-
deploy:
10+
permissions:
11+
contents: read
12+
id-token: write
1213

14+
jobs:
15+
publish:
1316
runs-on: ubuntu-latest
17+
environment:
18+
name: release
19+
url: https://pypi.org/p/opengsq
1420

1521
steps:
1622
- uses: actions/checkout@v5
23+
1724
- name: Set up Python
1825
uses: actions/setup-python@v6
1926
with:
2027
python-version: '3.x'
28+
2129
- name: Install dependencies
2230
run: |
2331
python -m pip install --upgrade pip
2432
pip install build
33+
2534
- name: Build package
2635
run: python -m build
36+
2737
- name: Publish package
2838
uses: pypa/gh-action-pypi-publish@release/v1
29-
with:
30-
user: __token__
31-
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)