Skip to content

Update to latest Mountpoint client crates (#212) #6

Update to latest Mountpoint client crates (#212)

Update to latest Mountpoint client crates (#212) #6

Workflow file for this run

name: Build Wheels
on:
push:
tags: [ "v[0-9]+.[0-9]+.[0-9]+" ]
branches: [ "dependabot/*", "main", "workflow/*" ]
workflow_dispatch:
env:
S3_REGION: ${{ vars.S3_REGION }}
S3_BUCKET: ${{ vars.S3_BUCKET }}
S3_PREFIX: ${{ vars.S3_PREFIX }}
S3_EXPRESS_BUCKET: ${{ vars.S3_EXPRESS_BUCKET }}
S3_EXPRESS_REGION: ${{ vars.S3_EXPRESS_REGION }}
jobs:
generate_third_party_licenses:
name: Generate THIRD-PARTY-LICENSES
uses: ./.github/workflows/generate_third_party_licenses.yml
build_wheels:
name: Wheels for ${{ matrix.python }} - ${{ matrix.builder.kind }} - ${{ matrix.builder.arch }}
runs-on: ${{ matrix.builder.runner }}
needs: generate_third_party_licenses
strategy:
matrix:
python:
- cp38
- cp39
- cp310
- cp311
- cp312
builder:
- runner: codebuild-${{ vars.CODEBUILD_PROJECT_NAME }}-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large
kind: manylinux
arch: x86_64
- runner: codebuild-${{ vars.CODEBUILD_PROJECT_NAME }}-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large
kind: manylinux
arch: aarch64
# - runner: ubuntu-20.04
# kind: manylinux
# arch: x86_64
- runner: macos-13
kind: macosx
arch: x86_64
- runner: macos-14
kind: macosx
arch: arm64
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
id: creds
with:
role-to-assume: ${{ vars.ACTIONS_IAM_ROLE }}
aws-region: ${{ vars.S3_REGION }}
# Downloading artifacts that were created from action/upload-artifact@v3 and below are not supported.
# https://github.com/actions/download-artifact
# These actions should remain @v3 for now, ignore dependabot proposed upgrade.
# https://github.com/actions/upload-artifact/issues/478
- uses: actions/download-artifact@v3
with:
name: ${{ needs.generate_third_party_licenses.outputs.artifact_name }}
- name: Rename third party license
run: |
mv NOTICE_DEFAULT THIRD-PARTY-LICENSES
# actions/setup-python requires /Users/runner/hostedtoolcache to exist to work properly
# with macosx due to fixed shared library path
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#macos
- name: Create hostedtoolcache dir for macosx
if: ${{ matrix.builder.kind == 'macosx' }}
run: |
mkdir -p /Users/runner/hostedtoolcache
# actions/setup-python doesn't yet support ARM
# https://github.com/actions/setup-python/issues/678
- name: Setup Python
if: ${{ matrix.builder.arch != 'aarch64' }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pipx
run: |
which python
which pip
python -m pip install --upgrade pip
python -m pip install --upgrade pipx
python -m pipx ensurepath
# Run cibuildwheel manually, as the current runner uses setup-python
# https://github.com/pypa/cibuildwheel/issues/1623
- run: >
python -m pipx run
cibuildwheel
"s3torchconnectorclient"
--output-dir "wheelhouse"
--only "${{ matrix.python }}-${{ matrix.builder.kind }}_${{ matrix.builder.arch }}"
2>&1
shell: bash
- uses: actions/upload-artifact@v3
with:
path: "./wheelhouse/*.whl"
name: wheels
build_source_wheels:
name: Build source wheels for ${{ matrix.build_target }}
runs-on: ubuntu-20.04
needs: generate_third_party_licenses
strategy:
matrix:
build_target:
- s3torchconnector
- s3torchconnectorclient
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: ${{ needs.generate_third_party_licenses.outputs.artifact_name }}
- name: Copy license files
run: |
cp README.md ${{ matrix.build_target }}/
cp LICENSE ${{ matrix.build_target }}/
cp NOTICE_DEFAULT ${{ matrix.build_target }}/THIRD-PARTY-LICENSES
cp NOTICE ${{ matrix.build_target }}/
- name: Build wheel
run: |
cd ${{ matrix.build_target }}
python -m pip install build
python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: "./${{ matrix.build_target }}/dist/*"
name: wheels