@@ -104,21 +104,42 @@ jobs:
104
104
with :
105
105
fetch-depth : 0
106
106
107
+ # TODO: Build wheels from sdist again
108
+ # There's some sort of weird race condition?
109
+ # within Github that makes the sdist be missing files
110
+
107
111
# We need to build wheels from the sdist since the sdist
108
112
# removes unnecessary files from the release
109
- - name : Download sdist
113
+ - name : Download sdist (not macOS)
114
+ if : ${{ matrix.buildplat[1] != 'macosx_*' }}
110
115
uses : actions/download-artifact@v3
111
116
with :
112
117
name : sdist
113
118
path : ./dist
114
119
120
+ - name : Set up Python (macOS)
121
+ if : ${{ matrix.buildplat[1] == 'macosx_*' }}
122
+ uses : actions/setup-python@v4
123
+ with :
124
+ python-version : ' 3.11'
125
+
126
+ # Python version used to build sdist doesn't matter
127
+ # wheel will be built from sdist with the correct version
128
+ - name : Build sdist (macOS)
129
+ if : ${{ matrix.buildplat[1] == 'macosx_*' }}
130
+ run : |
131
+ python -m pip install build
132
+ python -m build --sdist
133
+
134
+ - name : Output sdist name (macOS)
135
+ id : save-path
136
+ shell : bash -el {0}
137
+ run : echo "sdist_name=$(ls ./dist)" >> "$GITHUB_ENV"
138
+
115
139
- name : Build wheels
116
140
117
- # TODO: Build wheels from sdist again
118
- # There's some sort of weird race condition?
119
- # within Github that makes the sdist be missing files
120
141
with :
121
- package-dir : ./dist/${{ needs.build_sdist.outputs.sdist_file }}
142
+ package-dir : ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
122
143
env :
123
144
CIBW_PRERELEASE_PYTHONS : True
124
145
CIBW_BUILD : ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
0 commit comments