Skip to content

Commit cc047ea

Browse files
updating release action
1 parent a25965b commit cc047ea

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed
Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
1+
# This workflows will upload a Python Package to PyPI when a new release is created.
2+
# For more information see: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#
33

44
name: Upload Python Package
55

@@ -8,23 +8,49 @@ on:
88
types: [created]
99

1010
jobs:
11+
build:
12+
name: Build distribution 📦
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check-out repository
17+
uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.x"
24+
- name: Install dependencies
25+
run: >-
26+
python3 -m
27+
pip install
28+
build
29+
--user
30+
- name: Build a binary wheel and a source tarball
31+
run: python3 -m build
32+
- name: Store the distribution packages
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: python-package-distributions
36+
path: dist/
37+
- name: Verify dist directory
38+
run: ls -l dist
1139
pypi-publish:
40+
name: Publish to PyPI
41+
needs:
42+
- build
1243
runs-on: ubuntu-latest
1344
environment:
1445
name: pypi
1546
url: https://pypi.org/p/cjio
1647
permissions:
1748
id-token: write
1849
steps:
19-
- name: Check-out repository
20-
uses: actions/checkout@v2
21-
- name: Set up Python
22-
uses: actions/setup-python@v2
50+
- name: Download all the dists
51+
uses: actions/download-artifact@v4
2352
with:
24-
python-version: '3.x'
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install setuptools wheel twine
53+
name: python-package-distributions
54+
path: dist/
2955
- name: Publish to PyPI
3056
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)