From 3e2c3b506df0064a73f4246de3f96cb7f4e7d5ff Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 1 Nov 2023 05:57:53 -0500 Subject: [PATCH] workflows: generate sdist tarball in CI 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 --- .github/ISSUE_TEMPLATE/release.md | 1 - .github/workflows/python.yml | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index c480d1d0..9bdb55c1 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -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 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index e293ff24..296f2a0d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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. @@ -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