Skip to content

Commit

Permalink
workflows: generate sdist tarball in CI
Browse files Browse the repository at this point in the history
By omitting the `python -m build` -w argument in one job, verify that the
source tarball can successfully build a wheel.  Use that source tarball in
releases rather than building it on a developer's machine.

Signed-off-by: Benjamin Gilbert <bgilbert@cs.cmu.edu>
  • Loading branch information
bgilbert committed Nov 1, 2023
1 parent d6af87d commit 3e2c3b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- [ ] `git clean -dxf && mkdir dist`
- [ ] Find the [workflow run](https://github.com/openslide/openslide-python/actions) for the tag; download its docs and wheels artifacts
- [ ] `unzip /path/to/downloaded/openslide-python-wheels.zip && mv openslide-python-wheels-*/* dist/`
- [ ] `python setup.py sdist`
- [ ] `twine upload dist/*`
- [ ] Recompress tarball with `xz`
- [ ] Attach release notes to [GitHub release](https://github.com/openslide/openslide-python/releases/new); upload tarballs and wheels
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
os: [ubuntu-latest, macos-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
include:
- os: ubuntu-latest
python-version: "3.12"
sdist: sdist
# Python 3.8 is too old to support universal binaries, and
# setup-python's Python 3.9 and 3.10 won't build them. Use the
# last upstream patch releases that ship with installers.
Expand Down Expand Up @@ -82,7 +85,10 @@ jobs:
esac
- name: Build wheel
run: |
python -m build -w
if [ -z "${{ matrix.sdist }}" ]; then
wheel_only=-w
fi
python -m build $wheel_only
case "${{ matrix.os }}" in
ubuntu-*)
mkdir old
Expand Down

0 comments on commit 3e2c3b5

Please sign in to comment.