Skip to content

Commit c2bda5c

Browse files
author
Olivier
committed
fix release script
1 parent db9122b commit c2bda5c

File tree

1 file changed

+44
-19
lines changed

1 file changed

+44
-19
lines changed
Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
# This workflow will upload a Python Package using Twine when a release is created
1+
# This workflow will upload a Python Package to PyPI when a release is created
32
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
43

54
# This workflow uses actions that are not certified by GitHub.
@@ -17,24 +16,50 @@ permissions:
1716
contents: read
1817

1918
jobs:
20-
deploy:
19+
release-build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.x"
2128

29+
- name: Build release distributions
30+
run: |
31+
# NOTE: put your own distribution build steps here.
32+
python -m pip install build
33+
python -m build
34+
35+
- name: Upload distributions
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: release-dists
39+
path: dist/
40+
41+
pypi-publish:
2242
runs-on: ubuntu-latest
43+
needs:
44+
- release-build
45+
permissions:
46+
# IMPORTANT: this permission is mandatory for trusted publishing
47+
id-token: write
48+
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
51+
environment:
52+
name: pypi
53+
url: https://pypi.org/manage/project/asyncua
2354

2455
steps:
25-
- uses: actions/checkout@v4
26-
- name: Set up Python
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: '3.x'
30-
- name: Install dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
pip install build
34-
- name: Build package
35-
run: python -m build
36-
- name: Publish package
37-
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597
38-
with:
39-
user: __token__
40-
password: ${{ secrets.PYPI_API_TOKEN }}
56+
- name: Retrieve release distributions
57+
uses: actions/download-artifact@v4
58+
with:
59+
name: release-dists
60+
path: dist/
61+
62+
- name: Publish release distributions to PyPI
63+
uses: pypa/gh-action-pypi-publish@release/v1
64+
with:
65+
packages-dir: dist/

0 commit comments

Comments
 (0)