-
Notifications
You must be signed in to change notification settings - Fork 4
212 lines (189 loc) · 6.69 KB
/
Copy pathrelease.yml
File metadata and controls
212 lines (189 loc) · 6.69 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
# Stage 1: Build docc-compiler (no dependencies)
wheels-compiler:
name: Compiler (${{ matrix.os }}, ${{ matrix.python }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [build-amd64-big, build-arm64-big, macos-14]
python: ["cp311", "cp312", "cp313", "cp314"]
include:
- os: build-amd64-big
cibw_archs: x86_64
- os: build-arm64-big
cibw_archs: aarch64
- os: macos-14
cibw_archs: arm64
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BENCHMARK_TESTS_TOKEN }}
submodules: recursive
- uses: pypa/cibuildwheel@v3.3.1
with:
package-dir: python/
output-dir: wheelhouse
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BUILD: "${{ matrix.python }}-*"
- uses: actions/upload-artifact@v4
with:
name: wheels-docc-compiler-${{ matrix.os }}-${{ matrix.python }}
path: wheelhouse/*.whl
# Stage 2: Build docc-ai (depends on docc-compiler)
wheels-ai:
name: AI (${{ matrix.os }}, ${{ matrix.python }})
needs: [wheels-compiler]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [build-amd64-big, build-arm64-big, macos-14]
python: ["cp311", "cp312"]
include:
- os: build-amd64-big
cibw_archs: x86_64
- os: build-arm64-big
cibw_archs: aarch64
- os: macos-14
cibw_archs: arm64
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BENCHMARK_TESTS_TOKEN }}
submodules: recursive
# Pin docc-compiler version to match release
# - name: Pin docc-compiler version
# run: |
# VERSION=$(cat VERSION)
# sed -i.bak "s/\"docc-compiler\"/\"docc-compiler==$VERSION\"/" mlir/pyproject.toml && rm mlir/pyproject.toml.bak
# Download compiler wheels into the package directory so they're available in container
# - uses: actions/download-artifact@v4
# with:
# pattern: wheels-docc-compiler-${{ matrix.os }}-*
# path: mlir/compiler-wheels
# merge-multiple: true
- uses: pypa/cibuildwheel@v3.3.1
with:
package-dir: mlir/
output-dir: wheelhouse
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BUILD: "${{ matrix.python }}-*"
# Install docc-compiler before building docc-ai
# CIBW_BEFORE_BUILD: "pip install --no-index --find-links {project}/compiler-wheels docc-compiler"
# Make compiler wheels available for dependency resolution during test
# CIBW_ENVIRONMENT: "PIP_FIND_LINKS={project}/compiler-wheels"
- uses: actions/upload-artifact@v4
with:
name: wheels-docc-ai-${{ matrix.os }}-${{ matrix.python }}
path: wheelhouse/*.whl
wheels-publish:
needs: [wheels-compiler, wheels-ai]
runs-on: build-amd64-big
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@v1.10.0
packages-llvm:
strategy:
matrix:
include:
- platform: ubuntu-24.04
package-format: deb
cpack-generator: DEB
upload-dist-id: ubuntu
upload-dist-version: 24.04
runner: build-amd64-big
architecture: x64
image: daisytuner/docc-build-env-llvm21-ubuntu-24.04:latest-amd64
- platform: ubuntu-26.04
package-format: deb
cpack-generator: DEB
upload-dist-id: ubuntu
upload-dist-version: 26.04
runner: build-amd64-big
architecture: x64
image: daisytuner/docc-build-env-llvm21-ubuntu-26.04:latest-amd64
- platform: ubuntu-24.04
package-format: deb
cpack-generator: DEB
upload-dist-id: ubuntu
upload-dist-version: 24.04
runner: build-arm64-big
architecture: arm64
image: daisytuner/docc-build-env-llvm21-ubuntu-24.04:latest-arm64
- platform: rhel-10
package-format: rpm
cpack-generator: RPM
upload-dist-id: rhel
upload-dist-version: 10
upload-dist-platform-id: platform:el10
runner: build-amd64-big
architecture: x64
image: daisytuner/docc-build-env-llvm21-rhel-10:latest-amd64
- platform: debian-13
package-format: deb
cpack-generator: DEB
upload-dist-id: debian
upload-dist-version: 13
runner: build-amd64-big
architecture: x64
image: daisytuner/docc-build-env-llvm21-debian-13:latest-amd64
runs-on: ${{ matrix.runner }}
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BENCHMARK_TESTS_TOKEN }}
submodules: recursive
- name: Define Version
id: define_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build package
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_C_COMPILER=clang-21 \
-DCMAKE_CXX_COMPILER=clang++-21 \
-DCMAKE_BUILD_TYPE=Release \
-DINSTALL_GTEST=OFF \
-DBUILD_TESTS:BOOL=OFF \
-DLLVM_BUILD_FRONTEND=ON \
-DLLVM_BUILD_TESTS=OFF \
-DBUILD_BENCHMARKS:BOOL=OFF \
-DBUILD_BENCHMARKS_GOOGLE:BOOL=OFF \
-DRELEASE_PACKAGE=ON \
-DPACKAGE_WITH_TOOL_DEPS=ON \
..
ninja -j$(nproc)
cpack -G ${{ matrix.cpack-generator }}
- name: Upload docc package as Artifact
uses: actions/upload-artifact@v4
with:
name: docc-${{ matrix.platform }}-${{ matrix.architecture }}
path: "build/*.${{ matrix.package-format }}"
- name: Upload docc package to Firebase
uses: daisytuner/upload-distribution-action@main
with:
file: "build/*.${{ matrix.package-format }}"
version: ${{ steps.define_version.outputs.VERSION }}
architecture: ${{ matrix.architecture }}
dist-id: ${{ matrix.upload-dist-id }}
dist-version: ${{ matrix.upload-dist-version }}
dist-platform-id: ${{ matrix.upload-dist-platform-id }}
token: ${{ secrets.DOCC_RELEASE_TOKEN }}
url: /v1/system/docc-distributions/upload