-
Notifications
You must be signed in to change notification settings - Fork 5
138 lines (135 loc) · 4.27 KB
/
release.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
name: Release
on:
release:
types: [published]
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_TEST_COMMAND: "python -c \"import mlc\""
CIBW_SKIP: "cp313-win_amd64" # Python 3.13 is not quite ready yet
MLC_CIBW_VERSION: "2.20.0"
MLC_PYTHON_VERSION: "3.9"
MLC_CIBW_WIN_BUILD: "cp3*-win_amd64"
MLC_CIBW_MAC_BUILD: "cp3*-macosx_arm64"
MLC_CIBW_MAC_X86_BUILD: "cp3*-macosx_x86_64"
MLC_CIBW_LINUX_BUILD: "cp3*-manylinux_x86_64"
jobs:
windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: ${{ env.MLC_PYTHON_VERSION }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel=="${{ env.MLC_CIBW_VERSION }}"
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ env.MLC_CIBW_WIN_BUILD }}
- name: Show package contents
run: python scripts/show_wheel_content.py wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows
path: ./wheelhouse/*.whl
macos:
name: MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: ${{ env.MLC_PYTHON_VERSION }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==${{ env.MLC_CIBW_VERSION }}
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ env.MLC_CIBW_MAC_BUILD }}
- name: Show package contents
run: python scripts/show_wheel_content.py wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos
path: ./wheelhouse/*.whl
macos-x86:
name: MacOS-x86
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: ${{ env.MLC_PYTHON_VERSION }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==${{ env.MLC_CIBW_VERSION }}
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ env.MLC_CIBW_MAC_X86_BUILD }}
- name: Show package contents
run: python scripts/show_wheel_content.py wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-x86
path: ./wheelhouse/*.whl
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: ${{ env.MLC_PYTHON_VERSION }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==${{ env.MLC_CIBW_VERSION }}
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ env.MLC_CIBW_LINUX_BUILD }}
- name: Show package contents
run: python scripts/show_wheel_content.py wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux
path: ./wheelhouse/*.whl
publish:
name: Publish
runs-on: ubuntu-latest
needs: [windows, macos, linux, macos-x86]
environment:
name: pypi
url: https://pypi.org/p/mlc-python
permissions:
id-token: write
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.MLC_PYTHON_VERSION }}
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./wheelhouse
- name: Prepare distribution files
run: |
mkdir -p dist
mv wheelhouse/wheels-macos-x86/*.whl dist/
mv wheelhouse/wheels-macos/*.whl dist/
mv wheelhouse/wheels-linux/*.whl dist/
mv wheelhouse/wheels-windows/*.whl dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/