Skip to content

Commit 164be6d

Browse files
committed
GitHub workflow & universal binary for macOS
1 parent 8ae9c59 commit 164be6d

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build-Release
2+
on: workflow_dispatch
3+
jobs:
4+
build-linux:
5+
name: Build App for Linux x64
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout code
9+
uses: actions/checkout@v2
10+
with:
11+
submodules: true
12+
- name: Install Dependencies
13+
run: sudo apt-get update && sudo apt-get install cmake clang ninja-build libx11-dev libgtk-3-dev libssl-dev webkit2gtk-driver -y --no-install-recommends
14+
- name: Build
15+
run: mkdir -p build; cd build; cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release .. && cmake --build . --config release --target install
16+
- name: Compress App
17+
run: cd build/Release && zip -r -9 UnityHubNative-Linux.zip *.AppImage
18+
- name: Archive and upload artifacts
19+
uses: actions/upload-artifact@v2
20+
with:
21+
name: UnityHubNative-Linux64
22+
path: build/Release/UnityHubNative-Linux.zip
23+
24+
build-mac:
25+
name: Build App for macOS
26+
runs-on: macos-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
with:
31+
submodules: true
32+
- name: Build
33+
run: mkdir -p build; cd build; cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release .. && cmake --build . --config release --target install
34+
- name: Compress App
35+
run: cd build/release && zip -r -9 UnityHubNative-macOS.zip *.app
36+
- name: Archive and upload artifacts
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: UnityHubNative-macOS
40+
path: build/release/UnityHubNative-macOS.zip
41+
42+
build-windows:
43+
name: Build App for Windows
44+
runs-on: windows-latest
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v2
48+
with:
49+
submodules: true
50+
- name: Build
51+
run: mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=Release .. ; cmake .. ; cmake --build . --config release --target install
52+
- name: Compress App
53+
run: cd build\Release ; Compress-Archive -Path .\*.exe -DestinationPath UnityHubNative-win64.zip
54+
- name: Archive and upload artifacts
55+
uses: actions/upload-artifact@v2
56+
with:
57+
name: UnityHubNative-win64
58+
path: build\release\UnityHubNative-win64

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ if(MSVC)
1010
add_definitions(/Qpar)
1111
endif()
1212

13+
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")
14+
1315
file(GLOB source "source/*.cpp" "source/*.hpp" "source/*.h")
1416
add_executable("${PROJECT_NAME}" WIN32 ${source} "source/wxmac.icns" "source/windows.rc")
1517
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)

0 commit comments

Comments
 (0)