-
Notifications
You must be signed in to change notification settings - Fork 106
172 lines (160 loc) · 4.75 KB
/
accelerate-manylinux.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Build PyOpenGL-accelerate wheels with manylinux
on:
push:
branches:
- "master"
jobs:
tarballs:
name: Build source tarballs and root wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball for root
run: >-
python3 -m
build
--sdist
--wheel
--outdir dist/
.
- name: Build a source tarball for accelerate
run: >-
python3 -m
build
--sdist
--outdir accelerate/dist
accelerate
- name: Save Core Distributions
uses: actions/upload-artifact@v4
with:
name: core
path: dist/*
- name: Save Accelerate Distributions
uses: actions/upload-artifact@v4
with:
name: accel
path: accelerate/dist/*
wheels:
name: Build architecture-specific wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build wheels (develop)
uses: pypa/[email protected]
if: ${{ github.ref == 'refs/heads/develop' }}
with:
package-dir: "./accelerate"
output-dir: "./accelerate/dist"
env:
BUILD_EXTENSION: yes
CIBW_SKIP: "pp*"
- name: Build wheels (master)
uses: pypa/[email protected]
if: ${{ github.ref == 'refs/heads/master' }}
with:
package-dir: "./accelerate"
output-dir: "./accelerate/dist"
env:
BUILD_EXTENSION: yes
CIBW_SKIP: "pp*"
- name: Save wheels
uses: actions/upload-artifact@v4
with:
name: accel-binary-${{ matrix.os }}
path: accelerate/dist/*.whl
pypi-publish-accel:
name: Upload Accelerate ${{matrix.repo}}
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- wheels
- tarballs
# TODO: should be choosing the repo URL based on master/develop
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Download Accelerate
uses: actions/[email protected]
id: download-accelerate
with:
name: accel
path: dist
- name: Download Accelerate Binary Windows
uses: actions/[email protected]
id: download-accelerate-bin-windows
with:
name: accel-binary-windows-latest
path: dist
- name: Download Accelerate Binary Ubuntu
uses: actions/[email protected]
id: download-accelerate-bin-ubuntu
with:
name: accel-binary-ubuntu-latest
path: dist
- name: Download Accelerate Binary MacOS
uses: actions/[email protected]
id: download-accelerate-bin-macOS
with:
name: accel-binary-macOS-latest
path: dist
# retrieve your distributions here
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# Note: this is apparently different than the package-dir meaning in the cibuildwheel
packages-dir: "dist"
pypi-publish-core:
name: Upload Core to ${{matrix.repo}}
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- wheels
- tarballs
# TODO: should be choosing the repo URL based on master/develop
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Download Core
uses: actions/[email protected]
id: download
with:
name: core
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
id: upload
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# Note: this is apparently different than the package-dir meaning in the cibuildwheel
packages-dir: "dist"