46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
name: XGBoost-Python-Wheels
|
|
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
python-wheels:
|
|
name: Build wheel for ${{ matrix.platform_id }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
platform_id: macosx_x86_64
|
|
- os: macos-latest
|
|
platform_id: macosx_arm64
|
|
steps:
|
|
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
|
|
with:
|
|
submodules: 'true'
|
|
- name: Setup Python
|
|
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
|
|
with:
|
|
python-version: "3.8"
|
|
- name: Build wheels
|
|
run: bash tests/ci_build/build_python_wheels.sh ${{ matrix.platform_id }} ${{ github.sha }}
|
|
- name: Extract branch name
|
|
shell: bash
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
id: extract_branch
|
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')
|
|
- name: Upload Python wheel
|
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')
|
|
run: |
|
|
python -m pip install awscli
|
|
python -m awscli s3 cp wheelhouse/*.whl s3://xgboost-nightly-builds/${{ steps.extract_branch.outputs.branch }}/ --acl public-read
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }}
|