Skip to content

CI: Build sdist again on macOS #54411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,42 @@ jobs:
with:
fetch-depth: 0

# TODO: Build wheels from sdist again
# There's some sort of weird race condition?
# within Github that makes the sdist be missing files

# We need to build wheels from the sdist since the sdist
# removes unnecessary files from the release
- name: Download sdist
- name: Download sdist (not macOS)
if: ${{ matrix.buildplat[1] != 'macosx_*' }}
uses: actions/download-artifact@v3
with:
name: sdist
path: ./dist

- name: Set up Python (macOS)
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
uses: actions/setup-python@v4
with:
python-version: '3.11'

# Python version used to build sdist doesn't matter
# wheel will be built from sdist with the correct version
- name: Build sdist (macOS)
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
run: |
python -m pip install build
python -m build --sdist

- name: Output sdist name (macOS)
id: save-path
shell: bash -el {0}
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_ENV"

- name: Build wheels
uses: pypa/[email protected]
# TODO: Build wheels from sdist again
# There's some sort of weird race condition?
# within Github that makes the sdist be missing files
with:
package-dir: ./dist/${{ needs.build_sdist.outputs.sdist_file }}
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
Expand Down