Skip to content

Commit

Permalink
Tweak release workflow to build wheel from sdist in the job that prod…
Browse files Browse the repository at this point in the history
…uces the sdist
  • Loading branch information
brianschubert committed Sep 13, 2023
1 parent dd8cecf commit b107447
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b107447

Please sign in to comment.