-
Notifications
You must be signed in to change notification settings - Fork 141
195 lines (190 loc) · 6.01 KB
/
Copy pathrelease.yml
File metadata and controls
195 lines (190 loc) · 6.01 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
name: Release PyPI Wheel
on:
pull_request:
push:
branches:
- main
tags:
- v*
jobs:
release-macos:
runs-on: macos-14
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
steps:
- name: Cancel previous run
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install macOS dependencies
run: |
brew install swig qt@5
echo "BAZEL_RULES_QT_DIR=$(brew --prefix qt@5)" >> "$GITHUB_ENV"
- name: Install bazelisk
run: |
go install github.com/bazelbuild/bazelisk@latest
echo "$HOME/go/bin" >> "$GITHUB_PATH"
- name: Build
run: |
rm -rf dist
make RELEASE_PYTHON=${{ matrix.python-version }} bazel-release
pip3 install dist/*.whl --force-reinstall
- name: Test
run: |
make release-test
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: wheel-macos-${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: error
release-linux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Cancel previous run
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- name: Install build dependencies
run: |
dnf install -y git curl wget zsh gcc gcc-c++ make tmux golang java-17-openjdk-devel qt5-qtbase-devel qt5-qtdeclarative-devel
dnf clean all
ln -sf "$(qmake-qt5 -query QT_INSTALL_HEADERS)" /usr/include/qt
go install github.com/bazelbuild/bazelisk@latest
ln -sf /root/go/bin/bazelisk /usr/local/bin/bazelisk
ln -sf /root/go/bin/bazelisk /usr/local/bin/bazel
- name: Set up Python ${{ matrix.python-version }}
shell: bash
run: |
case "${{ matrix.python-version }}" in
3.11) PYBIN=/opt/python/cp311-cp311/bin ;;
3.12) PYBIN=/opt/python/cp312-cp312/bin ;;
3.13) PYBIN=/opt/python/cp313-cp313/bin ;;
*) echo "unsupported python version: ${{ matrix.python-version }}" >&2; exit 1 ;;
esac
echo "$PYBIN" >> "$GITHUB_PATH"
"$PYBIN/python3" --version
- name: Build
run: |
make pypi-wheel
pip3 install dist/*.whl --force-reinstall
- name: Test
run: |
make release-test
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: wheel-${{ matrix.python-version }}
path: wheelhouse/
if-no-files-found: error
release-windows:
runs-on: windows-2022
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
env:
BAZEL_SH: C:/Program Files/Git/usr/bin/bash.exe
MSYS2_ARG_CONV_EXCL: "*"
MSYS_NO_PATHCONV: "1"
USE_BAZEL_VERSION: "8.6.0"
steps:
- name: Cancel previous run
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Windows dependencies
shell: pwsh
run: |
choco install -y make ninja strawberryperl swig
- name: Install Qt 5
uses: jurplel/install-qt-action@v4
with:
version: "5.15.2"
arch: "win64_msvc2019_64"
set-env: "true"
- name: Export Qt location
shell: pwsh
run: |
Add-Content -Path $env:GITHUB_ENV -Value "BAZEL_RULES_QT_DIR=$env:QT_ROOT_DIR"
Add-Content -Path $env:GITHUB_PATH -Value "C:\Program Files\Git\usr\bin"
- name: Install bazelisk
shell: pwsh
run: |
go install github.com/bazelbuild/bazelisk@latest
Add-Content -Path $env:GITHUB_PATH -Value (Join-Path $HOME "go/bin")
- name: Build
shell: bash
run: |
rm -rf dist
make RELEASE_PYTHON=${{ matrix.python-version }} bazel-release
pip3 install dist/*.whl --force-reinstall
- name: Test
shell: bash
run: |
make release-test
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: wheel-windows-${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: error
publish:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [release-linux, release-macos, release-windows]
steps:
- uses: actions/download-artifact@v8
with:
pattern: wheel-*
path: artifact
merge-multiple: true
- name: Move files so the next action can find them
run: |
mkdir dist && mv artifact/* dist/
ls dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}