1
- # name: Build Tdlib Cross Compile
2
- # on: [workflow_dispatch]
3
- # jobs:
4
- # build-tdlib-desktop:
5
- # name: Build
6
- # runs-on: ${{ matrix.os }}
7
- # strategy:
8
- # matrix:
9
- # os: [ubuntu-20.04, windows-latest, macOS-latest]
10
- # include:
11
- # - os: ubuntu-20.04
12
- # output-name: linux
13
- # - os: macOS-latest
14
- # output-name: macos
15
- # - os: windows-latest
16
- # output-name: windows
17
- # steps:
18
- # - name: Export Release Timestamp
19
- # run: echo "APP_VERSION=v$(date +'%Y.%m.%d.%H.%M.%S')" >> $GITHUB_ENV
20
- # - uses: actions/checkout@v3
21
- # with:
22
- # repository: tdlib/td
23
- # - name: Install Dependencies
24
- # continue-on-error: true
25
- # run: |
26
- # if [ "$RUNNER_OS" == "Linux" ]; then
27
- # sudo apt update -y
28
- # sudo apt-get install -y make git zlib1g-dev libssl-dev gperf cmake clang libc++-dev libc++abi-dev ninja-build zip
29
- # fi
30
- # if [ "$RUNNER_OS" == "macOS" ]; then
31
- # brew update
32
- # brew upgrade
33
- # xcode-select --install
34
- # curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
35
- # brew install gperf cmake openssl coreutils
36
- # fi
37
- # if [ "$RUNNER_OS" == "Windows" ]; then
38
- # git clone https://github.com/Microsoft/vcpkg.git
39
- # cd vcpkg
40
- # git checkout 1b1ae50e1a69f7c659bd7d731e80b358d21c86ad
41
- # ./bootstrap-vcpkg.bat
42
- # ./vcpkg.exe install gperf:x64-windows openssl:x64-windows zlib:x64-windows
43
- # fi
44
- # shell: bash
45
- # - name: Compile Tdlib
46
- # continue-on-error: true
47
- # run: |
48
- # mkdir build
49
- # cd build
50
- # if [ "$RUNNER_OS" == "Linux" ]; then
51
- # cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
52
- # cmake --build .
53
-
54
- # fi
55
- # if [ "$RUNNER_OS" == "macOS" ]; then
56
- # cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl/ -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
57
- # cmake --build .
58
- # fi
59
- # if [ "$RUNNER_OS" == "Windows" ]; then
60
- # cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../vcpkg/scripts/buildsystems/vcpkg.cmake ..
61
- # cmake --build .
62
- # cd tdlib/bin
63
- # ls
64
- # mv libcrypto-1_1-x64.dll libcrypto-1_1.dll
65
- # mv libssl-1_1-x64.dll libssl-1_1.dll
66
- # 7z a -tzip dlls.zip libcrypto-1_1.dll libssl-1_1.dll tdjson.dll zlib1.dll
67
- # fi
68
- # shell: bash
69
- # - name: Publish Release
70
- # uses: marvinpinto/action-automatic-releases@latest
71
- # continue-on-error: true
72
- # with:
73
- # repo_token: "${{ github.token }}"
74
- # automatic_release_tag: "latest-tdlib-${{ matrix.output-name }}"
75
- # prerelease: false
76
- # title: "Release Tdlib ${{ matrix.output-name }}"
77
- # files: |
78
- # tdlib/.*
79
-
80
-
81
-
82
- name : Build Tdlib Cross Platform
83
-
1
+ name : Build Tdlib Cross Compile
84
2
on : [workflow_dispatch]
85
-
86
3
jobs :
87
-
88
-
89
-
90
-
91
- build-macos-intel :
92
- runs-on : macos-11
4
+ build-tdlib-desktop :
5
+ name : Build
6
+ runs-on : ${{ matrix.os }}
7
+ strategy :
8
+ matrix :
9
+ os : [ubuntu-20.04, windows-latest, macOS-latest]
10
+ include :
11
+ - os : ubuntu-20.04
12
+ output-name : linux
13
+ - os : macOS-latest
14
+ output-name : macos
15
+ - os : windows-latest
16
+ output-name : windows
93
17
steps :
18
+ - name : Export Release Timestamp
19
+ run : echo "APP_VERSION=v$(date +'%Y.%m.%d.%H.%M.%S')" >> $GITHUB_ENV
94
20
- uses : actions/checkout@v3
95
21
with :
96
22
repository : tdlib/td
97
-
98
- - name : setup
99
- run : |
100
- brew install gperf cmake coreutils
101
-
102
- - name : setup td
103
- run : |
104
- cd example/ios
105
- sed -i '.bak' '11s/.*/platforms="macOS"/' build-openssl.sh
106
- sed -i '.bak' '24s/.*/platforms="macOS"/' build.sh
107
-
108
- - name : build ssl
109
- run : |
110
- cd example/ios
111
- ./build-openssl.sh
112
-
113
- - name : build
114
- run : |
115
- cd example/ios
116
- ./build.sh
117
-
118
- # - name: fake build
119
- # run: |
120
- # mkdir -p example/ios/tdjson/macOS/lib/
121
- # cd example/ios/tdjson/macOS/lib/
122
- # echo "libtdjson" > libtdjson.dylib
123
-
124
- - name : zip
125
- run : |
126
- cd example/ios/tdjson/macOS/lib/
127
- zip libtdjson.zip libtdjson.dylib
128
-
129
- - name : Publish Release
130
- uses : marvinpinto/action-automatic-releases@latest
23
+ - name : Install Dependencies
131
24
continue-on-error : true
132
- with :
133
- repo_token : " ${{ github.token }}"
134
- automatic_release_tag : " latest-tdlib-macos"
135
- prerelease : false
136
- title : " Release Tdlib MacOs"
137
- files : |
138
- example/ios/tdjson/macOS/lib/libtdjson.zip
139
-
140
-
141
- build-ios :
142
- runs-on : macos-11
143
- steps :
144
- - uses : actions/checkout@v3
145
- with :
146
- repository : tdlib/td
147
-
148
- - name : setup
149
25
run : |
150
- brew install gperf cmake coreutils
151
-
152
- - name : setup td
153
- run : |
154
- mkdir native-build
155
- cd native-build
156
- cmake ..
157
- cmake --build . --target prepare_cross_compiling
158
- cd ../example/ios
159
- sed -i '.bak' '11s/.*/platforms="iOS"/' build-openssl.sh
160
- sed -i '.bak' '24s/.*/platforms="iOS"/' build.sh
161
-
162
- - name : build ssl
163
- run : |
164
- cd example/ios
165
- ./build-openssl.sh
166
-
167
- - name : build
168
- run : |
169
- cd example/ios
170
- ./build.sh
171
-
172
- # - name: fake build
173
- # run: |
174
- # mkdir -p example/ios/tdjson/iOS/lib/
175
- # cd example/ios/tdjson/iOS/lib/
176
- # echo "libtdjson" > libtdjson.dylib
177
-
178
- - name : zip
179
- run : |
180
- cd example/ios/tdjson/iOS/lib/
181
- zip libtdjson.zip libtdjson.dylib
182
-
183
- - name : Publish Release
184
- uses : marvinpinto/action-automatic-releases@latest
26
+ if [ "$RUNNER_OS" == "Linux" ]; then
27
+ sudo apt update -y
28
+ sudo apt-get install -y make git zlib1g-dev libssl-dev gperf cmake clang libc++-dev libc++abi-dev ninja-build zip
29
+ fi
30
+ if [ "$RUNNER_OS" == "macOS" ]; then
31
+ brew update
32
+ brew upgrade
33
+ xcode-select --install
34
+ curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
35
+ brew install gperf cmake openssl coreutils
36
+ fi
37
+ if [ "$RUNNER_OS" == "Windows" ]; then
38
+ git clone https://github.com/Microsoft/vcpkg.git
39
+ cd vcpkg
40
+ git checkout 1b1ae50e1a69f7c659bd7d731e80b358d21c86ad
41
+ ./bootstrap-vcpkg.bat
42
+ ./vcpkg.exe install gperf:x64-windows openssl:x64-windows zlib:x64-windows
43
+ fi
44
+ shell : bash
45
+ - name : Compile Tdlib
185
46
continue-on-error : true
186
- with :
187
- repo_token : " ${{ github.token }}"
188
- automatic_release_tag : " latest-tdlib-ios"
189
- prerelease : false
190
- title : " Release Tdlib Ios"
191
- files : |
192
- example/ios/tdjson/iOS/lib/libtdjson.zip
193
-
194
-
195
- build-linux-x64 :
196
- runs-on : ubuntu-24.04
197
- steps :
198
-
199
- - uses : actions/checkout@v3
200
- with :
201
- repository : tdlib/td
202
-
203
- - name : setup
204
- run : |
205
- sudo apt-get install make git zlib1g-dev libssl-dev gperf php-cli cmake g++
206
-
207
- - name : build
208
- run : |
209
- rm -rf build
210
- mkdir build
211
- cd build
212
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
213
- cmake --build .
214
-
215
-
216
- - name : zip
217
47
run : |
218
- cd tdlib/lib
219
- zip libtdjson.zip libtdjson.so
220
-
221
- - name : Publish Release
222
- uses : marvinpinto/action-automatic-releases@latest
223
- continue-on-error : true
224
- with :
225
- repo_token : " ${{ github.token }}"
226
- automatic_release_tag : " latest-tdlib-linux"
227
- prerelease : false
228
- title : " Release Tdlib Linux"
229
- files : |
230
- tdlib/lib/libtdjson.zip
231
-
232
- build-windows-x64 :
233
- runs-on : windows-2022
234
- steps :
235
- - uses : actions/checkout@v3
236
- with :
237
- repository : tdlib/td
238
-
239
-
240
- - name : setup vcpkg
241
- run : |
242
- git clone https://github.com/Microsoft/vcpkg.git
243
- cd vcpkg
244
- git checkout cd5e746ec203c8c3c61647e0886a8df8c1e78e41
245
- ./bootstrap-vcpkg.bat
246
- ./vcpkg.exe install gperf:x64-windows openssl:x64-windows zlib:x64-windows
247
-
248
- - name : build
249
- run : |
250
48
mkdir build
251
49
cd build
252
- cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../vcpkg/scripts/buildsystems/vcpkg.cmake ..
253
- cmake --build . --target install --config Release
254
-
255
- # - name: fake build
256
- # run: |
257
- # mkdir -p tdlib/bin
258
- # echo test > tdlib/bin/libcrypto-1_1-x64.dll
259
- # echo test > tdlib/bin/libssl-1_1-x64.dll
260
- # echo test > tdlib/bin/tdjson.dll
261
- # echo test > tdlib/bin/zlib1.dll
262
-
263
- - name : zip
264
- run : |
265
- cd tdlib/bin
266
- ls
267
- mv libcrypto -1_1-x64.dll libcrypto -1_1.dll
268
- mv libssl-1_1-x64 .dll libssl-1_1.dll
269
- 7z a -tzip libtdjson.zip libcrypto-1_1.dll libssl-1_1.dll tdjson.dll zlib1.dll
270
-
50
+ if [ "$RUNNER_OS" == "Linux" ]; then
51
+ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
52
+ cmake --build .
53
+
54
+ fi
55
+ if [ "$RUNNER_OS" == "macOS" ]; then
56
+ cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl/ -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
57
+ cmake --build .
58
+ fi
59
+ if [ "$RUNNER_OS" == "Windows" ]; then
60
+ cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../vcpkg/scripts/buildsystems/vcpkg.cmake ..
61
+ cmake --build .
62
+ cd tdlib/bin
63
+ ls
64
+ mv libcrypto-1_1-x64.dll libcrypto-1_1.dll
65
+ mv libssl -1_1-x64.dll libssl -1_1.dll
66
+ 7z a -tzip dlls.zip libcrypto-1_1 .dll libssl-1_1.dll tdjson.dll zlib1 .dll
67
+ fi
68
+ shell : bash
271
69
- name : Publish Release
272
70
uses : marvinpinto/action-automatic-releases@latest
273
71
continue-on-error : true
274
72
with :
275
73
repo_token : " ${{ github.token }}"
276
- automatic_release_tag : " latest-tdlib-windows "
74
+ automatic_release_tag : " latest-tdlib-${{ matrix.output-name }} "
277
75
prerelease : false
278
- title : " Release Tdlib Windows "
76
+ title : " Release Tdlib ${{ matrix.output-name }} "
279
77
files : |
280
- tdlib/bin/libtdjson.zip
78
+ tdlib/.*
79
+
0 commit comments