-
Notifications
You must be signed in to change notification settings - Fork 13
280 lines (278 loc) · 10.7 KB
/
m1.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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
name: Manual Build
on:
workflow_call:
inputs:
mcpelauncher-manifest-repo:
description: 'mcpelauncher repo'
default: 'https://github.com/minecraft-linux/mcpelauncher-manifest.git'
type: string
mcpelauncher-manifest-ref:
description: 'mcpelauncher ref'
default: 'ng'
type: string
submodule-refs:
type: string
default: "[]"
workflow_dispatch:
inputs:
mcpelauncher-manifest-repo:
description: 'mcpelauncher repo'
default: 'https://github.com/minecraft-linux/mcpelauncher-manifest.git'
type: string
mcpelauncher-manifest-ref:
description: 'mcpelauncher ref'
default: 'ng'
type: string
submodule-refs:
type: string
default: "[]"
jobs:
openssl:
runs-on: ${{ matrix.OS }}
strategy:
fail-fast: false
matrix:
include:
- OS: macos-latest
deps: ''
sdkroot: ''
version: '11.0'
arch: 'arm64'
opensslflags: darwin64-arm64
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.version }}
cache-name: cache-openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}
steps:
- name: Cache openssl
id: cache
uses: actions/cache@v3
with:
path: output
key: ${{ env.cache-name }}
- uses: actions/checkout@v1
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.OS, 'macOS') && matrix.sdkroot != '' && !startsWith(matrix.sdkroot, '/') }}
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
- name: Install Deps
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.deps != '' }}
run: ${{ matrix.deps }}
- name: Build OpenSSL
if: steps.cache.outputs.cache-hit != 'true'
shell: pwsh
run: |
if ('${{ matrix.sdkroot }}' -ne '') {
if ('${{ matrix.sdkroot }}'.StartsWith('/')) {
$Env:SDKROOT = '${{ matrix.sdkroot }}'
} else {
$Env:SDKROOT = '${{ github.workspace }}/${{ matrix.sdkroot }}'
}
}
git clone https://github.com/openssl/openssl.git -b openssl-3.2
$INSDIR = (Get-Location).ToString() + "/output"
pushd openssl
perl ./Configure ${{ matrix.opensslflags }} ('--prefix=' + $INSDIR)
make install_sw
- name: Create tar archive
run: |
install_name_tool -id @rpath/libssl.dylib -add_rpath @loader_path/../Frameworks lib/libssl.dylib || :
install_name_tool -id @rpath/libcrypto.dylib -add_rpath @loader_path/../Frameworks lib/libcrypto.dylib || :
tar cJf ../openssl.tar.xz .
working-directory: output
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}
path: output/
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}-tar
path: openssl.tar.xz
angle:
runs-on: ${{ matrix.OS }}
strategy:
fail-fast: false
matrix:
include:
- OS: macos-latest
deps: ''
version: '11.0'
arch: 'arm64'
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.version }}
cache-name: cache-angle-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}
steps:
- name: Cache angle
id: cache
uses: actions/cache@v3
with:
path: output
key: ${{ env.cache-name }}
- uses: actions/checkout@v1
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.OS, 'macOS') && matrix.sdkroot != '' && !startsWith(matrix.sdkroot, '/') }}
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
- name: Install Deps
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.deps != '' }}
run: ${{ matrix.deps }}
- name: Build angle
if: steps.cache.outputs.cache-hit != 'true'
shell: pwsh
run: |
if ('${{ matrix.sdkroot }}' -ne '') {
if ('${{ matrix.sdkroot }}'.StartsWith('/')) {
$Env:SDKROOT = '${{ matrix.sdkroot }}'
} else {
$Env:SDKROOT = '${{ github.workspace }}/${{ matrix.sdkroot }}'
}
}
$INSDIR = (Get-Location).ToString() + "/output"
mkdir $INSDIR
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$Env:PATH = $Env:PATH + ':' + $PWD.ToString() + '/depot_tools'
git clone https://github.com/minecraft-linux/angle.git -b angle-renderdragon
pushd angle
python scripts/bootstrap.py
gclient sync
@"
target_cpu="${{ matrix.arch }}"
is_debug=false
mac_sdk_min="${{ matrix.version }}"
mac_min_system_version="${{ matrix.version }}"
mac_deployment_target="${{ matrix.version }}"
angle_enable_metal=true
angle_enable_swiftshader=false
angle_enable_vulkan=false
"@ > ($INSDIR + "/args.gn")
if ('${{ matrix.sdkroot }}' -ne '') {
echo 'mac_sdk_path="' + $Env:SDKROOT + '"' >> ($INSDIR + "/args.gn")
}
echo "args.gn:"
cat ($INSDIR + "/args.gn")
echo "Confguring"
gn gen ($INSDIR)
autoninja -C ($INSDIR) libEGL libGLESv2
- name: Create tar archive
run: |
tar cJf ../angle.tar.xz .
working-directory: output
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: angle-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}
path: output/
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: angle-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}-tar
path: angle.tar.xz
build:
runs-on: ${{ matrix.OS }}
needs: [ "openssl" ]
strategy:
fail-fast: false
matrix:
include:
- AppImage: false
OS: macos-latest
arch: arm64
version: "11.0"
container: '{}'
deps: |
brew install autoconf automake
echo 'set(CMAKE_SYSTEM_NAME Darwin)' > toolchain.txt
echo 'set(CMAKE_SYSTEM_PROCESSOR aarch64)' >> toolchain.txt
triple: arm64-apple-darwin
cmakeextraflags: ('-DCMAKE_TOOLCHAIN_FILE='+ $INSDIR + '/../toolchain.txt')
openssl: true
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.version }}
CC: clang
CXX: clang++
DEBIAN_FRONTEND: noninteractive
# container: ${{ fromJson(matrix.container) }}
steps:
- uses: actions/checkout@v1
if: ${{ startsWith(matrix.OS, 'macOS') && matrix.sdkroot != '' && !startsWith(matrix.sdkroot, '/') }}
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
- name: Install Deps
shell: pwsh
run: ${{ matrix.deps }}
- name: Sync Submodule Sources
uses: actions/github-script@v6
with:
github-token: none
script: |
var downloadRepo = async function(path, repo, ref) {
await io.mkdirP(path);
await exec.exec("git", ["init"], { cwd: path });
await exec.exec("git", ["remote", "add", "origin", repo], { cwd: path });
await exec.exec("git", ["fetch", "origin", ref], { cwd: path });
await exec.exec("git", ["reset", "--hard", "FETCH_HEAD"], { cwd: path });
await exec.exec("git", ["submodule", "update", "--init", "--recursive"], { cwd: path });
};
await downloadRepo("mcpelauncher", process.env.MCPELAUNCHER_REPO, process.env.MCPELAUNCHER_REF);
var submoduleRefs = JSON.parse(process.env.SUBMODULEREFS);
for(var submoduleRef of submoduleRefs) {
if(submoduleRef.project === "mcpelauncher") {
await exec.exec("git", ["fetch", submoduleRef.origin || "origin", submoduleRef.ref], { cwd: `${submoduleRef.project}/${submoduleRef.path}` });
await exec.exec("git", ["checkout", "FETCH_HEAD"], { cwd: `${submoduleRef.project}/${submoduleRef.path}` });
}
}
env:
SUBMODULEREFS: ${{ inputs.submodule-refs || '[]' }}
MCPELAUNCHER_REPO: ${{ inputs.mcpelauncher-manifest-repo }}
MCPELAUNCHER_REF: ${{ inputs.mcpelauncher-manifest-ref }}
- uses: actions/download-artifact@v3
id: openssl
if: ${{ matrix.openssl }}
with:
name: openssl-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}
- name: Building mcpelauncher ${{ inputs.mcpelauncher-manifest-repo }}/${{ inputs.mcpelauncher-manifest-ref }}
shell: pwsh
env:
CC: clang
CXX: clang++
run: |
if ('${{ matrix.sdkroot }}' -ne '') {
if ('${{ matrix.sdkroot }}'.StartsWith('/')) {
$Env:SDKROOT = '${{ matrix.sdkroot }}'
} else {
$Env:SDKROOT = '${{ github.workspace }}/${{ matrix.sdkroot }}'
}
}
mkdir output
mkdir build
$INSDIR = (Get-Location).ToString() + "/output"
${{ matrix.envflags }}
pushd build
$EXTRA_FLAGS = ''
if ('${{steps.openssl.outputs.download-path}}' -ne '') {
brew uninstall --ignore-dependencies openssl@3
if ($EXTRA_FLAGS -ne '') {
$EXTRA_FLAGS += ' '
}
$EXTRA_FLAGS += '-DOPENSSL_ROOT_DIR=${{steps.openssl.outputs.download-path}}'
}
cmake ../mcpelauncher '-DCMAKE_BUILD_TYPE=Release' '-DBUILD_UI=OFF' ('-DCMAKE_INSTALL_PREFIX=' + $INSDIR) -DCMAKE_ASM_FLAGS="--target=${{ matrix.triple }}" -DCMAKE_C_FLAGS="--target=${{ matrix.triple }} ${{ matrix.cflags }}" -DCMAKE_CXX_FLAGS="--target=${{ matrix.triple }} ${{ matrix.cxxflags }}" -DCMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} $EXTRA_FLAGS ${{ matrix.cmakeextraflags }} '-DMSA_DAEMON_PATH=.' '-DENABLE_DEV_PATHS=OFF' '-DXAL_WEBVIEW_QT_PATH=.'
make install -j4
popd
popd
- name: Create tar archive
run: |
tar cJf ../mcpelauncher.tar.xz .
working-directory: output
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: mcpelauncher-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}
path: output/
- name: Upload tar
uses: actions/upload-artifact@v3
with:
name: mcpelauncher-${{ matrix.OS }}-${{ matrix.version }}-${{ matrix.arch }}-tar
path: mcpelauncher.tar.xz