-
Notifications
You must be signed in to change notification settings - Fork 23
876 lines (857 loc) · 37.3 KB
/
main.yml
File metadata and controls
876 lines (857 loc) · 37.3 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
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
on:
workflow_call:
inputs:
submodule-refs:
type: string
default: "[]"
mcpelauncher-repo:
type: string
default: https://github.com/minecraft-linux/mcpelauncher-manifest
mcpelauncher-ref:
type: string
default: ${{ github.repository == 'minecraft-linux/mcpelauncher-manifest' && (github.sha || github.ref) || 'ng' }}
mcpelauncher-ui-repo:
type: string
default: https://github.com/minecraft-linux/mcpelauncher-ui-manifest
mcpelauncher-ui-ref:
type: string
default: ${{ github.repository == 'minecraft-linux/mcpelauncher-ui-manifest' && (github.sha || github.ref) || 'ng' }}
msa-repo:
type: string
default: https://github.com/minecraft-linux/msa-manifest
msa-ref:
type: string
default: ${{ github.repository == 'minecraft-linux/msa-manifest' && (github.sha || github.ref) || 'master' }}
MacOSX1014sdkRepo:
type: string
default: ChristopherHX/MacOSX10.14.sdk
MacOSX1014sdkRef:
type: string
default: 18f574aa8d71402560dd3cbf349a9f8b2cec3833
use-repo-files:
type: boolean
default: false
publish:
type: boolean
default: false
draft:
type: boolean
default: false
offset:
type: number
default: 0
build-m1:
type: boolean
default: true
secrets:
MacOSX1014sdk:
description: 'A ssh key to download macOS sdk 10.14'
required: false
SPARKLE_ECDSA:
description: 'sparkle ecdsa public key'
required: false
SPARKLE_ECDSA_PUB:
description: 'sparkle ecdsa public key'
required: false
jobs:
build-libcxx32:
runs-on: macos-13
steps:
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_14.2.app
- name: Check Cache libcxx32
id: libcxx32-llvm
uses: ChristopherHX/check-cache@main
env:
cache-name: cache-libcxx32--macos-10-10-4
with:
path: libcxx32-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache libcxx32
if: steps.libcxx32-llvm.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-libcxx32--macos-10-10-4
with:
path: libcxx32-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- uses: actions/checkout@v5
if: steps.libcxx32-llvm.outputs.cache-hit != 'true'
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
- name: Build libcxx, libcxxabi
if: steps.libcxx32-llvm.outputs.cache-hit != 'true'
run: |
export MACOSX_DEPLOYMENT_TARGET=10.10.0
export SDKROOT=${{ github.workspace }}/../MacOSX-SDKs/MacOSX10.10.sdk
git clone https://github.com/llvm/llvm-project.git llvm -b release/10.x
mkdir -p libcxx32-build
cd libcxx32-build
cmake ../llvm/llvm -DHAVE_CXX_ATOMICS_WITHOUT_LIB=ON -DHAVE_CXX_ATOMICS64_WITHOUT_LIB=ON -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" -DCMAKE_BUILD_TYPE=Release -DLIBCXX_BUILD_32_BITS=ON -DLIBCXXABI_BUILD_32_BITS=ON -DLLVM_BUILD_32_BITS=ON
make -j8 cxx cxxabi
build-libcxx64:
runs-on: macos-13
steps:
- name: Check Cache libcxx64
id: libcxx64-llvm
uses: ChristopherHX/check-cache@main
env:
cache-name: cache-libcxx64--macos-10-10-4
with:
path: libcxx64-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache libcxx64
if: steps.libcxx64-llvm.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-libcxx64--macos-10-10-4
with:
path: libcxx64-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- uses: actions/checkout@v5
if: steps.libcxx64-llvm.outputs.cache-hit != 'true'
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
- name: Build libcxx, libcxxabi
if: steps.libcxx64-llvm.outputs.cache-hit != 'true'
run: |
export MACOSX_DEPLOYMENT_TARGET=10.10.0
export SDKROOT=${{ github.workspace }}/../MacOSX-SDKs/MacOSX10.10.sdk
git clone https://github.com/llvm/llvm-project.git llvm -b release/10.x
mkdir -p libcxx64-build
cd libcxx64-build
cmake ../llvm/llvm -DHAVE_CXX_ATOMICS_WITHOUT_LIB=ON -DHAVE_CXX_ATOMICS64_WITHOUT_LIB=ON -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" -DCMAKE_BUILD_TYPE=Release
make -j8 cxx cxxabi
build-libcxx:
runs-on: macos-13
needs: [build-libcxx32,build-libcxx64]
steps:
- name: Check libcxx
id: libcxx-llvm
uses: ChristopherHX/check-cache@main
env:
cache-name: cache-libcxx--macos-10-10-4
with:
path: libcxx-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache libcxx32
if: steps.libcxx-llvm.outputs.cache-hit != 'true'
id: libcxx32-llvm
uses: actions/cache@v4
env:
cache-name: cache-libcxx32--macos-10-10-4
with:
path: libcxx32-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache libcxx64
if: steps.libcxx-llvm.outputs.cache-hit != 'true'
id: libcxx64-llvm
uses: actions/cache@v4
env:
cache-name: cache-libcxx64--macos-10-10-4
with:
path: libcxx64-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache libcxx
if: steps.libcxx-llvm.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-libcxx--macos-10-10-4
with:
path: libcxx-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Build universal lib
if: steps.libcxx-llvm.outputs.cache-hit != 'true'
run: |
mkdir -p libcxx-build/
lipo -create libcxx32-build/lib/libc++.dylib libcxx64-build/lib/libc++.dylib -output libcxx-build/libc++.1.dylib
lipo -create libcxx32-build/lib/libc++abi.dylib libcxx64-build/lib/libc++abi.dylib -output libcxx-build/libc++abi.1.dylib
cd libcxx-build
ln -s libc++.1.dylib libc++.dylib
ln -s libc++abi.1.dylib libc++abi.dylib
install_name_tool -rpath @loader_path/../lib @loader_path/../Frameworks libc++.dylib
install_name_tool -rpath @loader_path/../lib @loader_path/../Frameworks libc++abi.dylib
buildopenssl32:
runs-on: macos-13
steps:
- name: Check for openssl
id: cache-openssl32
uses: ChristopherHX/check-cache@main
env:
cache-name: cache-openssl32-macos-10-10
with:
path: ssl32
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl
if: steps.cache-openssl32.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-openssl32-macos-10-10
with:
path: ssl32
key: ${{ runner.os }}-build-${{ env.cache-name }}
- uses: actions/checkout@v5
if: env.HAVE_SECRET && steps.cache-openssl32.outputs.cache-hit != 'true'
with:
repository: ${{ inputs.MacOSX1014sdkRepo}}
ref: ${{ inputs.MacOSX1014sdkRef }}
ssh-key: ${{ secrets.MacOSX1014sdk }}
path: MacOSX10.14.sdk
env:
HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }}
- uses: actions/checkout@v5
if: env.MISSING_SECRET && steps.cache-openssl32.outputs.cache-hit != 'true'
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
env:
MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }}
- name: Update env
if: steps.cache-openssl32.outputs.cache-hit != 'true'
run: |
echo MACOSX_DEPLOYMENT_TARGET=10.10.0 > $GITHUB_ENV
echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV
- name: Build OpenSSL
if: steps.cache-openssl32.outputs.cache-hit != 'true'
run: |
# Keep sing openssl 1.1.1 on 32bit, 3.2 refuses to configure
git clone https://github.com/openssl/openssl.git -b OpenSSL_1_1_1-stable
cd openssl
KERNEL_BITS=32 ./config --prefix="$PWD/../ssl32"
make -j8
sudo make install_sw -j8
buildopenssl64:
runs-on: macos-13
steps:
- name: Check for openssl
id: cache-openssl64
uses: ChristopherHX/check-cache@main
env:
cache-name: cache-openssl64-macos-10-10
with:
path: ssl64
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl
if: steps.cache-openssl64.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-openssl64-macos-10-10
with:
path: ssl64
key: ${{ runner.os }}-build-${{ env.cache-name }}
- uses: actions/checkout@v5
if: env.HAVE_SECRET && steps.cache-openssl64.outputs.cache-hit != 'true'
with:
repository: ${{ inputs.MacOSX1014sdkRepo}}
ref: ${{ inputs.MacOSX1014sdkRef }}
ssh-key: ${{ secrets.MacOSX1014sdk }}
path: MacOSX10.14.sdk
env:
HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }}
- uses: actions/checkout@v5
if: env.MISSING_SECRET && steps.cache-openssl64.outputs.cache-hit != 'true'
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
env:
MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }}
- name: Update env
if: steps.cache-openssl64.outputs.cache-hit != 'true'
run: |
echo MACOSX_DEPLOYMENT_TARGET=10.10.0 > $GITHUB_ENV
echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV
- name: Build OpenSSL
if: steps.cache-openssl64.outputs.cache-hit != 'true'
run: |
git clone https://github.com/openssl/openssl.git -b openssl-3.2
cd openssl
KERNEL_BITS=64 ./config --prefix="$PWD/../ssl64"
make -j8
sudo make install_sw -j8
buildopenssl:
runs-on: macos-13
needs: [buildopenssl32, buildopenssl64]
steps:
- name: Check openssl
id: openssl
uses: ChristopherHX/check-cache@main
env:
cache-name: cache-openssl-2
with:
path: ssl
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl
if: steps.openssl.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-openssl-2
with:
path: ssl
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl32
if: steps.openssl.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-openssl32-macos-10-10
with:
path: ssl32
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl64
if: steps.openssl.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-openssl64-macos-10-10
with:
path: ssl64
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Build universal lib
if: steps.openssl.outputs.cache-hit != 'true'
run: |
mkdir -p ssl/lib
lipo -create ssl32/lib/libssl.dylib ssl64/lib/libssl.dylib -output ssl/lib/libssl.dylib
lipo -create ssl32/lib/libcrypto.dylib ssl64/lib/libcrypto.dylib -output ssl/lib/libcrypto.dylib
cd ssl/lib
install_name_tool -id @rpath/libssl.dylib -add_rpath @loader_path/../Frameworks libssl.dylib
install_name_tool -id @rpath/libcrypto.dylib -add_rpath @loader_path/../Frameworks libcrypto.dylib
buildangle:
runs-on: macos-13
# needs: [buildangle32, buildangle64]
steps:
- name: Check angle
id: angle
uses: ChristopherHX/check-cache@main
env:
cache-name: cache-angle-3
with:
path: source/osx-angle-ci/artifacts
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache angle
if: steps.angle.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-angle-3
with:
path: source/osx-angle-ci/artifacts
key: ${{ runner.os }}-build-${{ env.cache-name }}
# See https://github.com/minecraft-linux/macos-builder/commit/2588136caaad8c993f3912d981dab13b9846360e for building it
# python2 now runs via python3 in macOS hosted runners
- uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
if: steps.angle.outputs.cache-hit != 'true'
- run: |
mkdir -p source/osx-angle-ci/artifacts
if: steps.angle.outputs.cache-hit != 'true'
- run: |
from subprocess import check_call as call
import shutil
from os import path
DMG_MOUNT_PATH = '/Volumes/Minecraft Bedrock Launcher/'
DMG_FILE = 'Minecraft Bedrock Launcher.dmg'
call(['curl', '-sL', '-o', DMG_FILE, 'https://github.com/minecraft-linux/macos-builder/releases/download/v0.12.2-448/Minecraft_Bedrock_Launcher_v0.12.2-macOS-x86_64-0.2.448_macOS_10.13.0.dmg'])
call(['hdiutil', 'attach', '-noautoopen', '-mountpoint', DMG_MOUNT_PATH, '-quiet', DMG_FILE])
shutil.copy2(path.join(DMG_MOUNT_PATH, 'Minecraft Bedrock Launcher.app', 'Contents', 'Frameworks', 'libEGL.dylib'), './source/osx-angle-ci/artifacts/libEGL.dylib', follow_symlinks = True)
shutil.copy2(path.join(DMG_MOUNT_PATH, 'Minecraft Bedrock Launcher.app', 'Contents', 'Frameworks', 'libGLESv2.dylib'), './source/osx-angle-ci/artifacts/libGLESv2.dylib', follow_symlinks = True)
shell: python
if: steps.angle.outputs.cache-hit != 'true'
- run: |
lipo -remove arm64 ./source/osx-angle-ci/artifacts/libEGL.dylib -output ./source/osx-angle-ci/artifacts/libEGL.dylib
lipo -remove arm64 ./source/osx-angle-ci/artifacts/libGLESv2.dylib -output ./source/osx-angle-ci/artifacts/libGLESv2.dylib
if: steps.angle.outputs.cache-hit != 'true'
build-protobuf:
runs-on: macos-13
steps:
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_14.2.app
- uses: actions/cache/restore@v4
id: cache
with:
path: protobuf-build
key: protobuf-macos-x64
lookup-only: true
- uses: actions/checkout@v5
if: env.HAVE_SECRET && steps.cache.outputs.cache-hit != 'true'
with:
repository: ${{ inputs.MacOSX1014sdkRepo}}
ref: ${{ inputs.MacOSX1014sdkRef }}
ssh-key: ${{ secrets.MacOSX1014sdk }}
path: MacOSX10.14.sdk
env:
HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }}
- uses: actions/checkout@v5
if: env.MISSING_SECRET && steps.cache.outputs.cache-hit != 'true'
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
env:
MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }}
- name: Update env
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo MACOSX_DEPLOYMENT_TARGET=10.10.0 > $GITHUB_ENV
echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV
- name: Install brew dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
brew install autoconf || :
brew install automake || :
brew install libtool || :
- name: Get Source Protobuf
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/protocolbuffers/protobuf.git -b 21.x protobuf
git -C protobuf submodule update --init --recursive
- name: Build Protobuf
if: steps.cache.outputs.cache-hit != 'true'
run: |
mkdir -p "$GITHUB_WORKSPACE/protobuf-build"
./autogen.sh
./configure --prefix="$GITHUB_WORKSPACE/protobuf-build"
make -j8
make install -j8
working-directory: protobuf
- uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: protobuf-build
key: protobuf-macos-x64
build-m1:
if: inputs.build-m1
uses: ./.github/workflows/m1.yml
with:
mcpelauncher-manifest-repo: ${{ inputs.mcpelauncher-repo }}
mcpelauncher-manifest-ref: ${{ inputs.mcpelauncher-ref }}
submodule-refs: ${{ inputs.submodule-refs }}
build:
runs-on: macos-13
if: "!(cancelled() || failure())"
needs: [build-libcxx, buildopenssl, buildangle, build-protobuf, build-m1]
permissions:
id-token: write # required to get an oidc token
contents: read
strategy:
fail-fast: false
matrix:
include:
- target: "10.10.0"
micro: 0
QT_BASE_URL: http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_592/
QT_VERSION_SHORT: 5.9.2
QT_VERSION: 5.9.2-0-201710050729
QT_PACKAGE_PREFIX: qt.592.
QT_PACKAGE_SUFFIX: clang_64
QT_PREBUILT_SUFFIX: -MacOS-OSX_10_10-Clang-MacOS-OSX_10_10-X86_64
extraflags: "--qtworkaround"
- target: "10.12.0"
micro: 1
QT_BASE_URL: http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5113/
QT_VERSION_SHORT: 5.11.3
QT_VERSION: 5.11.3-0-201811291904
QT_PACKAGE_PREFIX: qt.qt5.5113.
QT_PACKAGE_SUFFIX: clang_64
QT_PREBUILT_SUFFIX: -MacOS-MacOS_10_12-Clang-MacOS-MacOS_10_12-X86_64
- target: "10.13.0"
micro: 2
QT_BASE_URL: http://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5150/
QT_VERSION_SHORT: 5.15.0
QT_VERSION: 5.15.0-0-202005140805
QT_PACKAGE_PREFIX: qt.qt5.5150.
QT_PACKAGE_SUFFIX: clang_64
QT_PREBUILT_SUFFIX: -MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64
steps:
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_14.2.app
- name: Setup Vars
id: setup-vars
uses: actions/github-script@v7
with:
script: |
core.setOutput("owner", context.repo.owner);
core.setOutput("repo", context.repo.repo);
core.setOutput("build-number", "" + (${{ github.run_number }} + ${{ inputs.offset }}));
- uses: ChristopherHX/oidc@f8f35d97bc37ffbe779bb3ab8453920fedf6fb37
id: oidc
continue-on-error: true
- uses: actions/checkout@v5
with:
repository: ${{ steps.oidc.outputs.job_workflow_repo_name_and_owner || inputs.submodule-refs && 'minecraft-linux/macos-builder' || github.repository }}
ref: ${{ steps.oidc.outputs.job_workflow_repo_ref || inputs.submodule-refs && 'main' || github.sha || github.ref }}
- name: Sync Submodule Sources
if: ${{ !inputs.use-repo-files && inputs.submodule-refs }}
uses: actions/github-script@v7
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("source/mcpelauncher", process.env.MCPELAUNCHER_REPO, process.env.MCPELAUNCHER_REF);
await downloadRepo("source/mcpelauncher-ui", process.env.MCPELAUNCHER_UI_REPO, process.env.MCPELAUNCHER_UI_REF);
await downloadRepo("source/msa", process.env.MSA_REPO, process.env.MSA_REF);
var submoduleRefs = JSON.parse(process.env.SUBMODULEREFS);
for(var submoduleRef of submoduleRefs) {
await exec.exec("git", ["fetch", submoduleRef.origin || "origin", submoduleRef.ref], { cwd: `source/${submoduleRef.project}/${submoduleRef.path}` });
await exec.exec("git", ["checkout", "FETCH_HEAD"], { cwd: `source/${submoduleRef.project}/${submoduleRef.path}` });
}
env:
SUBMODULEREFS: ${{ inputs.submodule-refs }}
MCPELAUNCHER_REPO: ${{ inputs.mcpelauncher-repo }}
MCPELAUNCHER_REF: ${{ inputs.mcpelauncher-ref }}
MCPELAUNCHER_UI_REPO: ${{ inputs.mcpelauncher-ui-repo }}
MCPELAUNCHER_UI_REF: ${{ inputs.mcpelauncher-ui-ref }}
MSA_REPO: ${{ inputs.msa-repo }}
MSA_REF: ${{ inputs.msa-ref }}
- name: download m1 angle
if: inputs.build-m1
uses: actions/download-artifact@v4
with:
name: angle-macos-latest-11.0-arm64
path: "m1-artifacts"
- name: download m1 openssl
if: inputs.build-m1
uses: actions/download-artifact@v4
with:
name: openssl-macos-latest-11.0-arm64
path: "m1-artifacts"
- name: download m1 mcpelauncher
if: inputs.build-m1
uses: actions/download-artifact@v4
with:
name: mcpelauncher-macos-latest-11.0-arm64
path: "m1-artifacts"
- name: Cache libcxx32
id: libcxx32-llvm
uses: actions/cache@v4
env:
cache-name: cache-libcxx32--macos-10-10-4
with:
path: libcxx32-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache libcxx64
id: libcxx64-llvm
uses: actions/cache@v4
env:
cache-name: cache-libcxx64--macos-10-10-4
with:
path: libcxx64-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache libcxx
id: libcxx-llvm
uses: actions/cache@v4
env:
cache-name: cache-libcxx--macos-10-10-4
with:
path: libcxx-build
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl
uses: actions/cache@v4
env:
cache-name: cache-openssl-2
with:
path: ssl
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl32
uses: actions/cache@v4
env:
cache-name: cache-openssl32-macos-10-10
with:
path: ssl32
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache openssl64
uses: actions/cache@v4
env:
cache-name: cache-openssl64-macos-10-10
with:
path: ssl64
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: patch ssl
run: |
cd ssl32
rm -rf lib
ln -s ../ssl/lib
cd ../ssl64
rm -rf lib
ln -s ../ssl/lib
- name: Cache angle
if: steps.angle.outputs.cache-hit != 'true'
uses: actions/cache@v4
env:
cache-name: cache-angle-3
with:
path: source/osx-angle-ci/artifacts
key: ${{ runner.os }}-build-${{ env.cache-name }}
- uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: protobuf-build
key: protobuf-macos-x64
- name: brew install / link
run: |
brew install p7zip automake
brew uninstall openssl@3 || :
env:
HOMEBREW_NO_AUTO_UPDATE: 1
- name: Cache qt
if: 'false'
id: cache-qt
uses: actions/cache@v4
env:
cache-name: cache-qt-macos-${{ matrix.target }}
with:
path: qt
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Download Qt
# if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
./download_qt.sh
env:
QT_BASE_URL: ${{ matrix.QT_BASE_URL }}
QT_VERSION_SHORT: ${{ matrix.QT_VERSION_SHORT }}
QT_VERSION: ${{ matrix.QT_VERSION }}
QT_PACKAGE_PREFIX: ${{ matrix.QT_PACKAGE_PREFIX }}
QT_PACKAGE_SUFFIX: ${{ matrix.QT_PACKAGE_SUFFIX }}
QT_PREBUILT_SUFFIX: ${{ matrix.QT_PREBUILT_SUFFIX }}
- uses: actions/checkout@v5
if: env.HAVE_SECRET
with:
repository: ${{ inputs.MacOSX1014sdkRepo}}
ref: ${{ inputs.MacOSX1014sdkRef }}
ssh-key: ${{ secrets.MacOSX1014sdk }}
path: MacOSX10.14.sdk
env:
HAVE_SECRET: ${{ secrets.MacOSX1014sdk && '1' || '' }}
- uses: actions/checkout@v5
if: env.MISSING_SECRET
with:
repository: phracker/MacOSX-SDKs
ref: refs/heads/master
env:
MISSING_SECRET: ${{ !secrets.MacOSX1014sdk && '1' || '' }}
- name: Update env
run: |
echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.target }} > $GITHUB_ENV
echo SDKROOT=${{ github.workspace }}/${{ secrets.MacOSX1014sdk && 'MacOSX10.14.sdk' || '../MacOSX-SDKs/MacOSX10.13.sdk' }} >> $GITHUB_ENV
- name: Get Source libzip
run: |
git clone https://github.com/nih-at/libzip libzip
git -C libzip checkout v1.9.2
- name: Build libzip
run: |
cmake libzip -B libzip-build -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -DENABLE_BZIP2=OFF -DENABLE_LZMA=OFF -DENABLE_ZSTD=OFF -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DENABLE_FDOPEN=OFF
cmake --build libzip-build --parallel
sudo cmake --build libzip-build --target install --parallel
- name: Install python dependencies
run: pip3 install jinja2 ds_store
- name: add deps to base app
run: |
sudo cp -R protobuf-build/* /usr/local/
mkdir -p base-app/Contents/Frameworks/
cp libcxx-build/* base-app/Contents/Frameworks/
cp ssl/lib/* base-app/Contents/Frameworks/
cp ./source/osx-angle-ci/artifacts/* base-app/Contents/Frameworks/
- name: add m1 build
if: inputs.build-m1
run: |
mkdir -p base-app/Contents/Frameworks/
lipo -create m1-artifacts/lib/libssl.dylib base-app/Contents/Frameworks/libssl.dylib -output base-app/Contents/Frameworks/libssl.dylib
lipo -create m1-artifacts/lib/libcrypto.dylib base-app/Contents/Frameworks/libcrypto.dylib -output base-app/Contents/Frameworks/libcrypto.dylib
lipo -create m1-artifacts/libEGL.dylib base-app/Contents/Frameworks/libEGL.dylib -output base-app/Contents/Frameworks/libEGL.dylib
lipo -create m1-artifacts/libGLESv2.dylib base-app/Contents/Frameworks/libGLESv2.dylib -output base-app/Contents/Frameworks/libGLESv2.dylib
mkdir -p base-app/Contents/Resources/
cp -R m1-artifacts/share/* base-app/Contents/Resources/
mkdir -p base-app/Contents/MacOS/
cp m1-artifacts/bin/mcpelauncher-client base-app/Contents/MacOS/mcpelauncher-client-arm64-v8a
chmod +x base-app/Contents/MacOS/mcpelauncher-client-arm64-v8a
install_name_tool -add_rpath @loader_path/../Frameworks base-app/Contents/MacOS/mcpelauncher-client-arm64-v8a || :
- name: Build
run: |
python3 __main__.py --qt-path qt/*/*${{ secrets.SPARKLE_ECDSA_PUB && format('{0} {1}', ' --update-sparkle-appcast https://github.com/${GITHUB_REPOSITORY}/releases/download/ng.dmg/appcast.xml --update-sparkle-ed-public-key ', secrets.SPARKLE_ECDSA_PUB) }} --app-root base-app --build-id ${{ steps.setup-vars.outputs.build-number }} --prettyversion "$(cat version.txt)-macOS-x86_64-0.${{ matrix.micro }}.${{ steps.setup-vars.outputs.build-number }}" --version "0.${{ matrix.micro }}.${{ steps.setup-vars.outputs.build-number }}" ${{ matrix.extraflags }}${{ !inputs.use-repo-files && inputs.submodule-refs && ' --skip-sync-sources' || '' }}${{ secrets.MacOSX1014sdk && ' --use-own-curl' || '' }}
- name: Build .dmg
run: python3 build_dmg.py
- name: Generate Dist
run: |
DMG_FILENAME="Minecraft_Bedrock_Launcher_$(cat version.txt)-macOS-x86_64-0.${{ matrix.micro }}.${{ steps.setup-vars.outputs.build-number }}_macOS_${{ matrix.target }}.dmg"
mkdir -p dist
mv "${{ github.workspace }}/output/Minecraft Bedrock Launcher.dmg" "dist/${DMG_FILENAME}"
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: dmg-${{ matrix.target }}
path: dist
publish:
runs-on: macos-13
needs: build
# Eventually extend this job to be able to run on other repositories, otherwise replace the owner and repository name in this job
if: ${{ !cancelled() && inputs.publish }}
steps:
- uses: actions/checkout@v5
- name: Setup Env
run: |
echo "DMG_VERSION=$(cat version.txt)" >> $GITHUB_ENV
- name: Setup Vars
id: setup-vars
uses: actions/github-script@v7
with:
script: |
core.setOutput("owner", context.repo.owner);
core.setOutput("repo", context.repo.repo);
core.setOutput("build-number", "" + (${{ github.run_number }} + ${{ inputs.offset }}));
- name: Download everything
uses: actions/download-artifact@v4
with:
path: sparkle
pattern: dmg-*
- name: Download sparkle
run: |
curl -L -C - -o sparkle.tar.xz https://github.com/sparkle-project/Sparkle/releases/download/1.26.0/Sparkle-1.26.0.tar.xz
tar -xf ./sparkle.tar.xz
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Download some old dmg's and generate deltas
shell: python
run: |
from os import makedirs, fsencode, fsdecode, listdir, path, rename, getenv
import xml.etree.ElementTree as ET
from subprocess import check_call
makedirs('dist')
makedirs('dist2')
check_call(['curl', '-L', '-o', path.abspath(path.join('sparkle', 'appcast.xml')), 'https://github.com/${{ github.repository }}/releases/download/ng.dmg/appcast.xml'])
tree = ET.parse(path.join('sparkle', 'appcast.xml'))
root = tree.getroot()
i = 0
for rank in root.iter('item'):
enc = rank.find('enclosure')
url = enc.get('url')
check_call(['curl', '-L', '-o', path.abspath(path.join('sparkle', url[url.rfind('/')+1:])), url])
directory = fsencode('sparkle')
for file in listdir(directory):
filename = fsdecode(file)
if filename.endswith(".dmg"):
print(filename)
macindex = filename.rindex('macOS_') + 6
if macindex == 5:
continue
destdirname = path.join('sparkle', filename[macindex:len(filename)-4])
print(destdirname)
if not path.isdir(destdirname):
makedirs(destdirname)
rename(path.join('sparkle', filename), path.join(destdirname, filename))
tagname = 'invalid'
with open('version.txt', 'r') as file:
tagname = file.read().replace('\n', '') + '-' + getenv('BUILD_NUMBER')
print(tagname)
def dumpfile(f):
print('dumpfile: ' + f)
with open(f, 'r') as file:
print(file.read())
for file in listdir(directory):
ver = path.join('sparkle', fsdecode(file))
if not path.isdir(ver):
continue
founddmg = False
for file in listdir(ver):
filename = fsdecode(file)
if filename.endswith(".dmg"):
founddmg = True
break
if not founddmg:
continue
print(ver)
dumpfile(path.join('sparkle', 'appcast.xml'))
rename(path.join('sparkle', 'appcast.xml'), path.join(ver, 'appcast.xml'))
dumpfile(path.join(ver, 'appcast.xml'))
check_call(['./bin/generate_appcast', '-s', '${{ secrets.SPARKLE_ECDSA }}', '--download-url-prefix', 'https://github.com/${{ github.repository }}/releases/download/' + tagname + '/', ver ])
dumpfile(path.join(ver, 'appcast.xml'))
rename(path.join(ver, 'appcast.xml'), path.join('sparkle', 'appcast.xml'))
dumpfile(path.join('sparkle', 'appcast.xml'))
for file in listdir(ver):
filename = fsdecode(file)
if filename.endswith(".delta") or (filename.endswith(".dmg") and filename.find(getenv('BUILD_NUMBER') + '_macOS_') != -1):
print(filename)
rename(path.join(ver, filename), path.join('dist2', filename))
def register_all_namespaces(filename):
namespaces = dict([node for _, node in ET.iterparse(filename, events=['start-ns'])])
for ns in namespaces:
ET.register_namespace(ns, namespaces[ns])
dumpfile(path.join('sparkle', 'appcast.xml'))
register_all_namespaces(path.join('sparkle', 'appcast.xml'))
# Revert url changes
tree2 = ET.parse(path.join('sparkle', 'appcast.xml'))
root2 = tree2.getroot()
for rank in root2.iter('item'):
enc = rank.find('enclosure')
title = rank.find('title').text
for rank2 in root.iter('item'):
if title == rank2.find('title').text:
enc.set('url', rank2.find('enclosure').get('url'))
print(enc.get('url'))
break
tree2.write(path.join('dist', 'appcast.xml'), encoding='utf-8', xml_declaration=True)
dumpfile(path.join('dist', 'appcast.xml'))
tree2.write(path.join('dist2', 'appcast.xml'), encoding='utf-8', xml_declaration=True)
if: env.HAVE_SECRET
id: files-updated
env:
HAVE_SECRET: ${{ secrets.SPARKLE_ECDSA && '1' || '' }}
BUILD_NUMBER: ${{ steps.setup-vars.outputs.build-number }}
- name: download ghr
run: |
curl -L https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_darwin_amd64.zip --output ghr.zip
unzip ghr.zip
- name: Upload ${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]' && !inputs.draft) && 'Latest' || 'Draft' }}
if: steps.files-updated.result != 'skipped'
run: |
./ghr*/ghr -c ${{ github.sha }} -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} ${{ !(github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[DRAFT]') && !inputs.draft) && '-draft ' || '' }}-b "$LAUNCHER_RELEASE_DESCRIPTION$(cat changelog.txt)" "$(cat version.txt)-${{ steps.setup-vars.outputs.build-number }}" dist2/
env:
LAUNCHER_RELEASE_DESCRIPTION: |
Links for linux flatpak or AppImage can be found on our wiki https://minecraft-linux.github.io.
> [!WARNING]
> The current macOS port is about to stop receiving Minecraft updates in March 2025
> mojang is going to make OpenGL ES 3.1 required
> [!CAUTION]
> - You need to own Minecraft on the google play store and login with your google account to use this launcher
> - Only mac models first sold in 2012 or later can run versions after Minecraft 1.20.15
> [!IMPORTANT]
> - There is no arm64 dmg file
> - use the intel dmg for macOS 10.13 or newer
> - the game itself will run on arm64
> - Hi CPU Load
> - VSync is broken when not opt in to Metal in Profile Editor
> - Metal Mode may cause a black Screen on game versions after 1.18.15
> - The performance is better for linux, because we don't have to translate the Graphic Api
[Download link for intel or amd based 64bit systems ( known as amd64, intel64 and x86_64 e.g. most PC's or Laptops )](https://github.com/${{ github.repository }}/releases/download/${{env.DMG_VERSION}}-${{ steps.setup-vars.outputs.build-number }}/Minecraft_Bedrock_Launcher_${{env.DMG_VERSION}}-macOS-x86_64-0.2.${{ steps.setup-vars.outputs.build-number }}_macOS_10.13.0.dmg)
We don't support macOS 10.10 - 10.12, but are still providing releases for them under assets.
macOS x86_64 has no native OpenGL ES 2 or 3 framework
- translating the api via google/angle to OpenGL (Metal opt in, due to bug reports)
- possible more frame drops compared to linux
No sound on unsupported ancient mac's from pre 2012 in i386 compatibility mode
macOS/m1 mode is experimental and is very unstable, **since macOS 14 you are no longer able to use the intel game client and have to use the m1/arm64-v8 game client**
Please leave a comment https://github.com/minecraft-linux/mcpelauncher-manifest/discussions/819 if the arm64 game launcher doesn't work at all on your m1/m2 mac, together with the whole log file of the crash or the log after a force quit
# Not available Features you may miss
- Xbox live friend joining
- usually times out or crashs the game in both directions
- consider using the offical server software <https://www.minecraft.net/en-us/download/server/bedrock>
- connect all by ip as external server
- Xbox live login
- a lot of devices seem to get error code "drowned" without beeing asked for login
- error code "drowned" has more meanings like you closed the webview window without sign in
- there is no resolution for those getting this error
- programs that rewrite http requests sent by this launcher could also cause this problem
- all xbox http requests are signed by an ecdsa key
- the second request using the token for sisu auth are always rejected by Xbox Live Servers with http code 403 Forbidden
- this problem is not reproducable for developers
### Changelog
- name: Publish release
if: steps.files-updated.result != 'skipped' && !contains(github.event.head_commit.message, '[DRAFT]') && !inputs.draft
run: |
./ghr*/ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${{ steps.setup-vars.outputs.owner }} -r ${{ steps.setup-vars.outputs.repo }} -replace ng.dmg dist/