From b107447f3756db96f872793b9984a3d58b9ba9b3 Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Wed, 13 Sep 2023 10:01:04 -0400 Subject: [PATCH] Tweak release workflow to build wheel from sdist in the job that produces the sdist --- .github/workflows/release.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6102506..08e466a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,8 @@ name: Release on: push: + branches: + - 'feat/build-wheels-from-sdist' tags: - 'v[0-9]+.[0-9]+.[0-9]+' # Only run for full release tags @@ -51,15 +53,15 @@ jobs: name: 6s-archives path: 6s-archives - - name: Build wheel - run: python -I -m build --wheel + # Only build source distribution in a single job. + # In the job that builds the source distribution, call 'build' with no arguments so that it builds the wheel + # from the sdist. In all other jobs, the wheel is built directly from the source directory. + # This way, we confirm that wheels can be successfully built from the sdist. + - name: Build wheel ${{ matrix.sdist && "and sdist" }} + run: python -I -m build ${{ !matrix.sdist && "--wheel" }} env: SIXS_ARCHIVE_DIR: 6s-archives - - name: Build sdist - if: ${{ matrix.sdist }} - run: python -I -m build --sdist - - uses: actions/upload-artifact@v3 with: name: dist @@ -69,7 +71,7 @@ jobs: publish: needs: build -# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') runs-on: ubuntu-latest permissions: id-token: write