|
47 | 47 | description: "Name of the actual python package that is imported" |
48 | 48 | default: "" |
49 | 49 | type: string |
| 50 | + build-platform: |
| 51 | + description: Platform to build wheels, choose from 'python-build-package' or 'setup-py' |
| 52 | + required: false |
| 53 | + type: string |
| 54 | + default: 'setup-py' |
| 55 | + build-command: |
| 56 | + description: The build command to use if build-platform is python-build-package |
| 57 | + required: false |
| 58 | + default: "python -m build --wheel" |
| 59 | + type: string |
50 | 60 | trigger-event: |
51 | 61 | description: "Trigger Event in caller that determines whether or not to upload" |
52 | 62 | default: "" |
@@ -232,23 +242,41 @@ jobs: |
232 | 242 | ${CONDA_RUN} ${ENV_SCRIPT} python setup.py clean |
233 | 243 | fi |
234 | 244 | fi |
235 | | - - name: Build the wheel (bdist_wheel) X64 |
| 245 | + - name: Set PYTORCH_VERSION on x64 |
236 | 246 | if: inputs.architecture == 'x64' |
237 | 247 | working-directory: ${{ inputs.repository }} |
238 | | - env: |
239 | | - ENV_SCRIPT: ${{ inputs.env-script }} |
240 | | - BUILD_PARAMS: ${{ inputs.wheel-build-params }} |
241 | 248 | run: | |
242 | 249 | source "${BUILD_ENV_FILE}" |
243 | | -
|
244 | 250 | if [[ "$CU_VERSION" == "cpu" ]]; then |
245 | 251 | # CUDA and CPU are ABI compatible on the CPU-only parts, so strip |
246 | 252 | # in this case |
247 | 253 | export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')" |
248 | 254 | else |
249 | 255 | export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//')" |
250 | 256 | fi |
251 | | -
|
| 257 | + - name: Build the wheel (python-build-package) X64 |
| 258 | + if: ${{ inputs.build-platform == 'python-build-package' && inputs.architecture == 'x64' }} |
| 259 | + working-directory: ${{ inputs.repository }} |
| 260 | + env: |
| 261 | + ENV_SCRIPT: ${{ inputs.env-script }} |
| 262 | + BUILD_PARAMS: ${{ inputs.wheel-build-params }} |
| 263 | + run: | |
| 264 | + source "${BUILD_ENV_FILE}" |
| 265 | + ${CONDA_RUN} python -m pip install build==1.2.2 |
| 266 | + echo "Successfully installed Python build package" |
| 267 | + if [[ -z "${ENV_SCRIPT}" ]]; then |
| 268 | + ${CONDA_RUN} ${{ inputs.build-command }} |
| 269 | + else |
| 270 | + ${CONDA_RUN} ${ENV_SCRIPT} ${{ inputs.build-command }} |
| 271 | + fi |
| 272 | + - name: Build the wheel (setup-py) X64 |
| 273 | + if: ${{ inputs.build-platform == 'setup-py' && inputs.architecture == 'x64' }} |
| 274 | + working-directory: ${{ inputs.repository }} |
| 275 | + env: |
| 276 | + ENV_SCRIPT: ${{ inputs.env-script }} |
| 277 | + BUILD_PARAMS: ${{ inputs.wheel-build-params }} |
| 278 | + run: | |
| 279 | + source "${BUILD_ENV_FILE}" |
252 | 280 | if [[ -z "${ENV_SCRIPT}" ]]; then |
253 | 281 | ${CONDA_RUN} python setup.py bdist_wheel |
254 | 282 | else |
|
0 commit comments