|
| 1 | +name: Build Python wheels targeting Windows ARM64 |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read # to fetch code (actions/checkout) |
| 7 | + |
| 8 | +defaults: |
| 9 | + run: |
| 10 | + shell: pwsh |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +env: |
| 17 | + BRANCH_NAME: >- |
| 18 | + ${{ github.event.pull_request.number && 'PR-' }}${{ github.event.pull_request.number || github.ref_name }} |
| 19 | + |
| 20 | +jobs: |
| 21 | + python-wheels-Win-ARM64: |
| 22 | + name: Build wheel for Windows ARM64 |
| 23 | + runs-on: windows-11-arm |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + submodules: 'true' |
| 28 | + |
| 29 | + - name: Setup Python |
| 30 | + uses: actions/setup-python@v4 |
| 31 | + with: |
| 32 | + python-version: '3.11' |
| 33 | + |
| 34 | + - name: Install build dependencies |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade pip |
| 37 | + python -m pip install wheel setuptools awscli |
| 38 | +
|
| 39 | + - name: Build XGBoost for Win-ARM64 |
| 40 | + run: | |
| 41 | + mkdir build |
| 42 | + cd build |
| 43 | + cmake .. -G"Visual Studio 17 2022" -A ARM64 |
| 44 | + cmake --build . --config Release -- /m /nodeReuse:false "/consoleloggerparameters:ShowCommandLine;Verbosity=minimal" |
| 45 | + |
| 46 | + - name: Build XGBoost Python wheel for Win-ARM64 |
| 47 | + run: | |
| 48 | + # Patch to rename pkg to xgboost-cpu |
| 49 | + python ops/script/pypi_variants.py --use-cpu-suffix=1 --require-nccl-dep=0 |
| 50 | + cd python-package |
| 51 | + mkdir -p wheelhouse |
| 52 | + pip wheel --no-deps -v . --wheel-dir wheelhouse/ |
| 53 | + $wheelFile = Get-ChildItem wheelhouse/*.whl | Select-Object -First 1 -ExpandProperty FullName |
| 54 | + python -m wheel tags --python-tag py3 --abi-tag none --platform win_arm64 --remove $wheelFile |
| 55 | +
|
| 56 | + - name: Upload Python wheel |
| 57 | + if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') |
| 58 | + run: | |
| 59 | + $wheelFile = Get-ChildItem python-package/wheelhouse/*.whl | Select-Object -First 1 -ExpandProperty FullName |
| 60 | + python ops/pipeline/manage-artifacts.py upload ` |
| 61 | + --s3-bucket xgboost-nightly-builds ` |
| 62 | + --prefix ${{ env.BRANCH_NAME }}/${{ github.sha }} --make-public ` |
| 63 | + $wheelFile |
| 64 | + env: |
| 65 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} |
| 66 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} |
0 commit comments