-
-
Notifications
You must be signed in to change notification settings - Fork 191
160 lines (132 loc) · 5.4 KB
/
compile-macos.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
name: Compile macOS binaries
on:
push:
branches: [ master, device-rename ]
pull_request:
branches: [ master ]
release:
types:
- published
- prereleased
workflow_dispatch:
jobs:
build-universal:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.101
- name: Build NativeInterop.xcodeproj
uses: sersoft-gmbh/xcodebuild-action@v3
with:
project: GalaxyBudsClient.Platform.OSX/Native/NativeInterop.xcodeproj
scheme: NativeInterop
destination: platform=macOS
build-settings: CONFIGURATION_BUILD_DIR=/Users/runner/work/GalaxyBudsClient/GalaxyBudsClient/GalaxyBudsClient.Platform.OSX/Native/Build/Release CONFIGURATION_TEMP_DIR=/Users/runner/work/GalaxyBudsClient/GalaxyBudsClient/GalaxyBudsClient.Platform.OSX/Native/Build/Intermediates.noindex
action: build
- name: Restore workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore --configfile GalaxyBudsClient/nuget.config GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Build Universal
run: dotnet publish -o bin_osx -c Release --no-restore GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: GalaxyBudsClient_osx-universal
path: bin_osx/Galaxy Buds Manager-*.pkg
build-x64:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.101
- name: Build NativeInterop.xcodeproj
uses: sersoft-gmbh/xcodebuild-action@v3
with:
project: GalaxyBudsClient.Platform.OSX/Native/NativeInterop.xcodeproj
scheme: NativeInterop
destination: platform=macOS,arch=x86_64
build-settings: ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO CONFIGURATION_BUILD_DIR=/Users/runner/work/GalaxyBudsClient/GalaxyBudsClient/GalaxyBudsClient.Platform.OSX/Native/Build/Release CONFIGURATION_TEMP_DIR=/Users/runner/work/GalaxyBudsClient/GalaxyBudsClient/GalaxyBudsClient.Platform.OSX/Native/Build/Intermediates.noindex
action: build
- name: Restore workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore -r osx-x64 --configfile GalaxyBudsClient/nuget.config GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Build x64
run: dotnet publish -r osx-x64 -o bin_osxx64 -c Release --self-contained true --no-restore GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: GalaxyBudsClient_osx-x64
path: bin_osxx64/Galaxy Buds Manager-*.pkg
build-arm64:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.101
- name: Build NativeInterop.xcodeproj
uses: sersoft-gmbh/xcodebuild-action@v3
with:
project: GalaxyBudsClient.Platform.OSX/Native/NativeInterop.xcodeproj
scheme: NativeInterop
destination: platform=macOS,arch=arm64
build-settings: ARCHS=arm64 ONLY_ACTIVE_ARCH=NO CONFIGURATION_BUILD_DIR=/Users/runner/work/GalaxyBudsClient/GalaxyBudsClient/GalaxyBudsClient.Platform.OSX/Native/Build/Release CONFIGURATION_TEMP_DIR=/Users/runner/work/GalaxyBudsClient/GalaxyBudsClient/GalaxyBudsClient.Platform.OSX/Native/Build/Intermediates.noindex
action: build
- name: Restore workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore -r osx-arm64 --configfile GalaxyBudsClient/nuget.config GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Build arm64
run: dotnet publish -r osx-arm64 -o bin_osxarm64 -c Release --self-contained true --no-restore GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: GalaxyBudsClient_osx-arm64
path: bin_osxarm64/Galaxy Buds Manager-*.pkg
attach-to-release:
runs-on: ubuntu-latest
needs: [build-universal, build-x64, build-arm64]
if: github.event_name == 'release'
steps:
- name: Download setup artifact (Universal)
uses: actions/download-artifact@v4
with:
name: GalaxyBudsClient_osx-universal
- name: Rename (Universal)
run: mv "Galaxy Buds Manager"-*.pkg GalaxyBudsClient_macOS_universal.pkg
- name: Download setup artifact (x64)
uses: actions/download-artifact@v4
with:
name: GalaxyBudsClient_osx-x64
- name: Rename (x64)
run: mv "Galaxy Buds Manager"-*.pkg GalaxyBudsClient_macOS_x64.pkg
- name: Download artifact (arm64)
uses: actions/download-artifact@v4
with:
name: GalaxyBudsClient_osx-arm64
- name: Rename (arm64)
run: mv "Galaxy Buds Manager"-*.pkg GalaxyBudsClient_macOS_arm64.pkg
- uses: AButler/[email protected]
with:
files: '*.pkg'
repo-token: ${{ secrets.GH_TOKEN }}