1
1
name : Build macOS Universal Binary
2
+
2
3
on :
3
4
push :
4
5
branches :
5
6
- ' master'
7
+ release :
8
+ types : [published] # Trigger on published release
6
9
7
10
jobs :
8
11
build-universal-macos :
16
19
17
20
- name : Install Dependencies
18
21
run : |
19
- # Install essential tools (native)
20
22
brew update
21
23
brew install cmake ninja llvm
22
24
@@ -27,60 +29,63 @@ jobs:
27
29
./bootstrap-vcpkg.sh
28
30
echo "VCPKG_ROOT=$PWD" >> $GITHUB_ENV
29
31
echo "$VCPKG_ROOT" >> $GITHUB_PATH
30
- ls $VCPKG_ROOT
31
32
32
33
- name : Install Boost for x86_64
33
34
run : |
34
35
$VCPKG_ROOT/vcpkg install --triplet=x64-osx
35
36
36
37
- name : Install Boost for arm64
37
38
run : |
38
- $VCPKG_ROOT/vcpkg install --triplet=arm64-osx
39
+ $VCPKG_ROOT/vcpkg install --triplet=arm64-osx
39
40
40
41
- name : Configure Build with vcpkg for x86_64
41
42
run : |
42
43
mkdir -p build_x86_64
43
44
cd build_x86_64
44
45
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" \
45
- -DCMAKE_OSX_ARCHITECTURES="x86_64"\
46
- -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
46
+ -DCMAKE_OSX_ARCHITECTURES="x86_64" \
47
+ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
47
48
48
49
- name : Build Project for x86_64
49
50
run : |
50
51
cd build_x86_64
51
52
cmake --build .
52
- # mkdir -p ../artifacts
53
- # cp -v bin/shinysocks ../artifacts/shinysocks_x86_64
54
-
53
+
55
54
- name : Configure Build with vcpkg for arm64
56
55
run : |
57
56
mkdir -p build_arm64
58
57
cd build_arm64
59
58
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" \
60
- -DCMAKE_OSX_ARCHITECTURES="arm64"\
59
+ -DCMAKE_OSX_ARCHITECTURES="arm64" \
61
60
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
62
61
63
62
- name : Build Project for arm64
64
63
run : |
65
64
cd build_arm64
66
65
cmake --build .
67
- # mkdir -p ../artifacts
68
- # cp -v bin/shinysocks ../artifacts/shinysocks_arm64
69
-
70
- - name : Combine the binaries into a universal binary
66
+
67
+ - name : Combine the binaries into a universal binary
71
68
run : |
72
69
mkdir -p artifacts
73
- lipo -create -output artifacts/universal_binary \
70
+ lipo -create -output artifacts/shinysocks-macos \
74
71
build_x86_64/bin/shinysocks \
75
72
build_arm64/bin/shinysocks
76
-
73
+
77
74
- name : Verify Universal Binary
78
75
run : |
79
- file artifacts/universal_binary
76
+ file artifacts/shinysocks-macos
80
77
81
78
- name : Archive Artifacts
82
79
uses : actions/upload-artifact@v4
83
80
with :
84
81
name : logfault-macos
85
82
path : artifacts/*
86
83
retention-days : 1
84
+
85
+ - name : Upload Release Artifact
86
+ if : github.event_name == 'release'
87
+ uses : softprops/action-gh-release@v2
88
+ with :
89
+ files : artifacts/shinysocks-macos
90
+ name : shinysocks-macos
91
+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments