-
Notifications
You must be signed in to change notification settings - Fork 18
157 lines (139 loc) · 4.8 KB
/
wheels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
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 }}
# extend role time out to 2 hours
role-duration-seconds: 7200
- uses: actions/download-artifact@v4
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@v4
with:
path: "./wheelhouse/*.whl"
name: wheels-${{ matrix.python }}-${{ matrix.builder.kind }}_${{ matrix.builder.arch }}
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@v4
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@v4
with:
path: "./${{ matrix.build_target }}/dist/*"
name: wheels-${{ matrix.build_target }}
merge:
name: Merge the wheels
runs-on: ubuntu-latest
needs:
- build_wheels
- build_source_wheels
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: wheels
pattern: wheels-*