This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
185 lines (147 loc) · 4.86 KB
/
release.yml
File metadata and controls
185 lines (147 loc) · 4.86 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
name: Release
on:
workflow_dispatch:
inputs:
USE_LOCAL_VERSION:
description: 'use local version for wheel'
type: string
default: 1
BUNDLE_MLIR_PYTHON_BINDINGS:
description: 'bundle mlir python bindings'
type: string
default: 1
# release:
# types:
# - published
# push:
# branches:
# - main
# pull_request:
# paths:
# - .github/workflows/release.yml
concurrency:
group: ci-build-release-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
SYSTEM_VERSION_COMPAT: 0
PIP_FIND_LINKS: "https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13, macos-14, windows-2022, ubuntu-22.04-arm ]
py_version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
gpu: [ "cuda", "amdgpu", "none" ]
exclude:
- os: macos-13
py_version: "3.9"
- os: macos-14
py_version: "3.9"
- os: macos-13
gpu: "cuda"
- os: macos-13
gpu: "amdgpu"
- os: macos-14
gpu: "cuda"
- os: macos-14
gpu: "amdgpu"
- os: windows-2022
gpu: "cuda"
- os: windows-2022
gpu: "amdgpu"
- os: ubuntu-22.04-arm
gpu: "cuda"
- os: ubuntu-22.04-arm
gpu: "amdgpu"
name: Release "${{ matrix.os }}-${{ matrix.py_version }} ${{ matrix.gpu != 'none' && matrix.gpu || '' }}"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
allow-prereleases: true
- name: Get bindings metadata
shell: bash
run: |
echo "BINDINGS_VERSION=$(python scripts/get_latest_bindings.py ${{ matrix.gpu }})" >> $GITHUB_ENV
echo "BUNDLE_MLIR_PYTHON_BINDINGS=${{ inputs.BUNDLE_MLIR_PYTHON_BINDINGS != '' && inputs.BUNDLE_MLIR_PYTHON_BINDINGS || 1 }}" >> $GITHUB_ENV
echo "USE_LOCAL_VERSION=${{ inputs.USE_LOCAL_VERSION != '' && inputs.USE_LOCAL_VERSION || 1 }}" >> $GITHUB_ENV
echo "PLAT=$(python scripts/get_latest_bindings.py ${{ matrix.gpu }} --only-plat)" >> $GITHUB_ENV
echo "GPU=${{ matrix.gpu }}" >> $GITHUB_ENV
- name: Build wheel
shell: bash
run: |
if [ "$BUNDLE_MLIR_PYTHON_BINDINGS" == "1" ]; then
pip install mlir-python-bindings==$BINDINGS_VERSION -t tmp
cp -R tmp/mlir $PWD
fi
pip wheel . -v -w wheelhouse
- name: auditwheel
if: (startsWith(matrix.os, 'ubuntu') && env.BUNDLE_MLIR_PYTHON_BINDINGS == '1')
shell: bash
run: |
pip install auditwheel
mv wheelhouse/mlir_python_extras-*.whl $PWD
auditwheel repair mlir_python_extras-*.whl -w wheelhouse --plat $PLAT --exclude libmlir_float16_utils* --exclude libcuda*
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/mlir_python_extras-*.whl
name: build_artifact-${{ matrix.os }}-${{ matrix.py_version }}-${{ matrix.gpu }}
upload_bindings_wheels:
if: github.event_name != 'pull_request'
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: build_artifact-*
path: dist
merge-multiple: true
- name: Release current commit
uses: ncipollo/release-action@v1.12.0
with:
artifacts: "dist/*.whl"
token: "${{ secrets.GITHUB_TOKEN }}"
tag: "latest"
name: "latest"
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true
artifactErrorsFailBuild: true
- name: Release current commit
uses: ncipollo/release-action@v1.12.0
with:
owner: makslevental
repo: wheels
artifacts: "dist/*.whl"
token: "${{ secrets.WHEELS_REPO }}"
tag: "i"
name: "i"
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true
artifactErrorsFailBuild: true
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: build_artifact-sdist