Skip to content

Commit 7787499

Browse files
Ryan Whitmorebrandonwillard
authored andcommitted
Update the pypi github action to include wheel deployment and wheel
testing.
1 parent 1bc7d0d commit 7787499

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

.github/workflows/pypi.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,41 @@ concurrency:
1818

1919
jobs:
2020
build:
21-
name: Build source distribution
21+
name: Build distributions
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525
with:
2626
fetch-depth: 0
27-
- uses: actions/setup-python@v2
27+
- uses: actions/setup-python@v4
2828
with:
29-
python-version: "3.8"
30-
- name: Build the sdist
29+
python-version: "3.9"
30+
- name: Install build dependencies
3131
run: |
32-
python setup.py sdist
32+
python -m pip install --upgrade pip
33+
python -m pip install build
34+
- name: Build sdist and wheel
35+
run: |
36+
python -m build
3337
- name: Check the sdist installs and imports
3438
run: |
3539
mkdir -p test-sdist
3640
cd test-sdist
3741
python -m venv venv-sdist
3842
venv-sdist/bin/python -m pip install ../dist/cons-*.tar.gz
39-
- uses: actions/upload-artifact@v2
43+
- name: Check the wheel installs and imports
44+
run: |
45+
mkdir -p test-wheel
46+
cd test-wheel
47+
python -m venv venv-wheel
48+
venv-wheel/bin/python -m pip install ../dist/cons-*.whl
49+
- uses: actions/upload-artifact@v4
4050
with:
4151
name: artifact
4252
path: dist/*
4353

4454
upload_pypi:
45-
name: Upload to PyPI on release
55+
name: Upload distributions to PyPI on release
4656
needs: [build]
4757
runs-on: ubuntu-latest
4858
if: github.event_name == 'release' && github.event.action == 'published'
@@ -51,7 +61,7 @@ jobs:
5161
with:
5262
name: artifact
5363
path: dist
54-
- uses: pypa/gh-action-pypi-publish@master
64+
- uses: pypa/gh-action-pypi-publish@release/v1
5565
with:
5666
user: __token__
5767
password: ${{ secrets.pypi_secret }}

0 commit comments

Comments
 (0)