|
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: ""
|
@@ -224,23 +234,41 @@ jobs:
|
224 | 234 | ${CONDA_RUN} ${ENV_SCRIPT} python setup.py clean
|
225 | 235 | fi
|
226 | 236 | fi
|
227 |
| - - name: Build the wheel (bdist_wheel) X64 |
| 237 | + - name: Set PYTORCH_VERSION on x64 |
228 | 238 | if: inputs.architecture == 'x64'
|
229 | 239 | working-directory: ${{ inputs.repository }}
|
230 |
| - env: |
231 |
| - ENV_SCRIPT: ${{ inputs.env-script }} |
232 |
| - BUILD_PARAMS: ${{ inputs.wheel-build-params }} |
233 | 240 | run: |
|
234 | 241 | source "${BUILD_ENV_FILE}"
|
235 |
| -
|
236 | 242 | if [[ "$CU_VERSION" == "cpu" ]]; then
|
237 | 243 | # CUDA and CPU are ABI compatible on the CPU-only parts, so strip
|
238 | 244 | # in this case
|
239 | 245 | export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')"
|
240 | 246 | else
|
241 | 247 | export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//')"
|
242 | 248 | fi
|
243 |
| -
|
| 249 | + - name: Build the wheel (python-build-package) X64 |
| 250 | + if: ${{ inputs.build-platform == 'python-build-package' && inputs.architecture == 'x64' }} |
| 251 | + working-directory: ${{ inputs.repository }} |
| 252 | + env: |
| 253 | + ENV_SCRIPT: ${{ inputs.env-script }} |
| 254 | + BUILD_PARAMS: ${{ inputs.wheel-build-params }} |
| 255 | + run: | |
| 256 | + source "${BUILD_ENV_FILE}" |
| 257 | + ${CONDA_RUN} python -m pip install build==1.2.2 |
| 258 | + echo "Successfully installed Python build package" |
| 259 | + if [[ -z "${ENV_SCRIPT}" ]]; then |
| 260 | + ${CONDA_RUN} ${{ inputs.build-command }} |
| 261 | + else |
| 262 | + ${CONDA_RUN} ${ENV_SCRIPT} ${{ inputs.build-command }} |
| 263 | + fi |
| 264 | + - name: Build the wheel (setup-py) X64 |
| 265 | + if: ${{ inputs.build-platform == 'setup-py' && inputs.architecture == 'x64' }} |
| 266 | + working-directory: ${{ inputs.repository }} |
| 267 | + env: |
| 268 | + ENV_SCRIPT: ${{ inputs.env-script }} |
| 269 | + BUILD_PARAMS: ${{ inputs.wheel-build-params }} |
| 270 | + run: | |
| 271 | + source "${BUILD_ENV_FILE}" |
244 | 272 | if [[ -z "${ENV_SCRIPT}" ]]; then
|
245 | 273 | ${CONDA_RUN} python setup.py bdist_wheel
|
246 | 274 | else
|
|
0 commit comments