@@ -112,6 +112,17 @@ jobs:
112112 run : |
113113 git clone --depth 1 https://github.com/tdlib/td.git
114114 cd td
115+ sed -i '
116+ /^if[[:space:]]*(NOT CMAKE_CROSSCOMPILING)[[:space:]]*$/{
117+ N
118+ s/^if[[:space:]]*(NOT CMAKE_CROSSCOMPILING)[[:space:]]*\n[[:space:]]*add_executable(tg_cli /if (FALSE)\n add_executable(tg_cli /
119+ }
120+ ' CMakeLists.txt
121+ sed -i '
122+ s/^[[:space:]]*add_subdirectory(benchmark)[[:space:]]*$/# add_subdirectory(benchmark)/;
123+ s/^[[:space:]]*add_subdirectory(test)[[:space:]]*$/# add_subdirectory(test)/
124+ ' CMakeLists.txt
125+
115126 cat << EOF > vcpkg.json
116127 {
117128 "dependencies": [ "gperf", "openssl", "zlib" ],
@@ -149,6 +160,73 @@ jobs:
149160 name : wheels-windows
150161 path : ./wheelhouse/*.whl
151162
163+ macos-build :
164+ needs : prepare
165+ runs-on : tenki-macos-latest-small
166+ env :
167+ MACOSX_DEPLOYMENT_TARGET : " 11.0"
168+
169+ steps :
170+ - uses : actions/checkout@v4
171+
172+ - name : Download updated files
173+ uses : actions/download-artifact@v4
174+ with :
175+ name : updated-files
176+ path : .
177+
178+ - name : Set up Python
179+ uses : actions/setup-python@v4
180+ with :
181+ python-version : ${{ env.USING_PYTHON_VERSION }}
182+
183+ - name : Install Python dependencies
184+ run : python -m pip install --upgrade cibuildwheel
185+
186+ - name : Build OpenSSL 1.1.1
187+ run : |
188+ sudo -E git clone --depth 1 --branch OpenSSL_1_1_1-stable https://github.com/openssl/openssl.git
189+ cd openssl
190+ sudo -E perl ./Configure darwin64-arm64-cc --prefix=/usr/local --openssldir=/usr/local/openssl
191+ sudo -E make -j
192+ sudo -E make install MANDIR=/usr/local/openssl/share/man MANSUFFIX=ssl
193+
194+ - name : Build TDLib
195+ run : |
196+ git clone https://github.com/tdlib/td.git
197+ cd td
198+ sed -i '' '
199+ /^if[[:space:]]*(NOT CMAKE_CROSSCOMPILING)[[:space:]]*$/{
200+ N
201+ s/^if[[:space:]]*(NOT CMAKE_CROSSCOMPILING)[[:space:]]*\n[[:space:]]*add_executable(tg_cli /if (FALSE)\n add_executable(tg_cli /
202+ }
203+ ' CMakeLists.txt
204+ sed -i '' '
205+ s/^[[:space:]]*add_subdirectory(benchmark)[[:space:]]*$/# add_subdirectory(benchmark)/;
206+ s/^[[:space:]]*add_subdirectory(test)[[:space:]]*$/# add_subdirectory(test)/
207+ ' CMakeLists.txt
208+
209+ rm -rf build
210+ mkdir build
211+ cd build
212+ sudo -E cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DTD_ENABLE_LTO=ON ..
213+ sudo -E cmake --build . --target install
214+ cd ..
215+ cd ..
216+ ls -l /usr/local
217+
218+ - name : Build wheels
219+
220+ run : |
221+ mkdir -p ./wheelhouse
222+ sudo -E python -m cibuildwheel . --output-dir ./wheelhouse
223+
224+ - name : Upload wheels
225+ uses : actions/upload-artifact@v4
226+ with :
227+ name : wheels-macos
228+ path : ./wheelhouse/*.whl
229+
152230 publish :
153231 needs : [prepare, linux-build, windows-build]
154232 runs-on : ubuntu-latest
0 commit comments