-
Notifications
You must be signed in to change notification settings - Fork 19
154 lines (129 loc) · 4.18 KB
/
build-release-macos-app-bundles.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
name: Build release macOS app bundles
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_TERM_COLOR: always
RELEASE_FEATURES: xq-audio,discord-presence,dldi
DEBUG_FEATURES: xq-audio,discord-presence,log,debug-views,dldi
DEBUG_GDB_FEATURES: xq-audio,discord-presence,log,debug-views,pu-checks,gdb-server,dldi
MACOSX_DEPLOYMENT_TARGET: 10.11
BUILD_APP_BUNDLE: true
jobs:
build:
name: Build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- id: toolchain
name: Install nightly toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
targets: x86_64-apple-darwin, aarch64-apple-darwin
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-registry
enableCrossOsArchive: true
- name: Cache build directory
uses: actions/cache@v4
with:
path: target/
key: macos-app-release-${{ steps.toolchain.outputs.cachekey }}
- name: Prepare empty bundle
run: |
mkdir -p Dust.app/Contents/MacOS Dust.app/Contents/Resources
cp frontend/desktop/platform/macos/Info.plist Dust.app/Contents
cp frontend/desktop/platform/macos/Dust.icns Dust.app/Contents/Resources
cp -R frontend/desktop/fonts Dust.app/Contents/Resources
cp -R render/wgpu-2d/src/common/shaders Dust.app/Contents/Resources
- name: Update dependencies
run: cargo update
- name: Build release bundle (no debugging features)
run: >
cargo build
--verbose
--profile ci
--target x86_64-apple-darwin
--no-default-features
--features=${{ env.RELEASE_FEATURES }}
--package dust-desktop
cargo build
--verbose
--profile ci
--target aarch64-apple-darwin
--no-default-features
--features=${{ env.RELEASE_FEATURES }}
--package dust-desktop
lipo
target/x86_64-apple-darwin/ci/dust-desktop
target/aarch64-apple-darwin/ci/dust-desktop
-create
-output Dust.app/Contents/MacOS/Dust
tar -cf Dust.app.tar.gz Dust.app
- name: Upload release bundle (no debugging features)
uses: actions/upload-artifact@v4
with:
name: macOS-app
path: Dust.app.tar.gz
- name: Build release bundle (debugging features)
run: >
cargo build
--verbose
--profile ci
--target x86_64-apple-darwin
--no-default-features
--features=${{ env.DEBUG_FEATURES }}
--package dust-desktop
cargo build
--verbose
--profile ci
--target aarch64-apple-darwin
--no-default-features
--features=${{ env.DEBUG_FEATURES }}
--package dust-desktop
lipo
target/x86_64-apple-darwin/ci/dust-desktop
target/aarch64-apple-darwin/ci/dust-desktop
-create
-output Dust.app/Contents/MacOS/Dust
tar -cf Dust.app.tar.gz Dust.app
- name: Upload release bundle (debugging features)
uses: actions/upload-artifact@v4
with:
name: macOS-app-debug
path: Dust.app.tar.gz
- name: Build release bundle (debugging features + GDB)
run: >
cargo build
--verbose
--profile ci
--target x86_64-apple-darwin
--no-default-features
--features=${{ env.DEBUG_GDB_FEATURES }}
--package dust-desktop
cargo build
--verbose
--profile ci
--target aarch64-apple-darwin
--no-default-features
--features=${{ env.DEBUG_GDB_FEATURES }}
--package dust-desktop
lipo
target/x86_64-apple-darwin/ci/dust-desktop
target/aarch64-apple-darwin/ci/dust-desktop
-create
-output Dust.app/Contents/MacOS/Dust
cp -R frontend/desktop/src/emu/gdb_server/specs Dust.app/Contents/Resources
tar -cf Dust.app.tar.gz Dust.app
- name: Upload release bundle (debugging features + GDB)
uses: actions/upload-artifact@v4
with:
name: macOS-app-debug-gdb
path: Dust.app.tar.gz