Skip to content

use correct variable #93

use correct variable

use correct variable #93

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: Build wheels for ${{ matrix.build_prefix }} - ${{ matrix.builder.arch }}
runs-on: ${{ matrix.builder.runner }}
needs: generate_third_party_licenses
strategy:
matrix:
build_prefix:
- cp38
- cp39
- cp310
- cp311
- cp312
builder:
- runner: codebuild-${{ vars.CODEBUILD_PROJECT_NAME }}-ubuntu-7.0-large
arch: x86_64
- runner: codebuild-${{ vars.CODEBUILD_PROJECT_NAME }}-arm-3.0-large
arch: aarch64
# - runner: ubuntu-20.04
# arch: x86_64
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 doesn't yet support ARM
# https://github.com/actions/setup-python/issues/678
- if: ${{ matrix.builder.arch != 'aarch64' }}
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pipx
run: |
python -m pip install --upgrade pipx
# 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.build_prefix }}-manylinux_${{ 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