Skip to content

Commit 119e196

Browse files
committed
Update CI/CD workflow
1 parent 81a1dc7 commit 119e196

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will upload a Python Package to PyPI when a release is published
22
# For more information see:
3+
# - https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
34
# - https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
4-
# - https://github.com/pypa/gh-action-pypi-publish
55

66
name: Upload Python Package
77

@@ -10,24 +10,42 @@ on:
1010
types: [published]
1111

1212
jobs:
13-
deploy:
14-
name: Build and publish to PyPI
13+
build:
14+
name: Build package
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
1921
- name: Set up Python
2022
uses: actions/setup-python@v2
2123
with:
2224
python-version: "3.x"
23-
- name: Install dependencies
25+
- name: Install pypa/build
2426
run: |
2527
python -m pip install --upgrade pip
26-
pip install --upgrade setuptools wheel
27-
- name: Build
28+
pip install --upgrade build
29+
- name: Build package
2830
run: |
29-
python setup.py sdist bdist_wheel
30-
- name: Publish to PyPI
31+
python -m build
32+
- name: Upload dist files
33+
uses: actions/upload-artifact@v2
34+
with:
35+
name: dist-files
36+
path: dist/
37+
if-no-files-found: error
38+
publish:
39+
name: Publish to PyPI
40+
needs: [build]
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Download dist files
44+
uses: actions/download-artifact@v2
45+
with:
46+
name: dist-files
47+
path: dist/
48+
- name: Publish package to PyPI
3149
uses: pypa/gh-action-pypi-publish@release/v1
3250
with:
3351
user: __token__

0 commit comments

Comments
 (0)