-
Notifications
You must be signed in to change notification settings - Fork 19
132 lines (114 loc) · 3.54 KB
/
build-release.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
name: Build release binaries
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
jobs:
build:
name: Build (${{ matrix.artifact }})
strategy:
matrix:
include:
- os: windows-latest
artifact: Windows
artifact-extension: .exe
target: x86_64-pc-windows-msvc
- os: ubuntu-latest
artifact: Linux
target: x86_64-unknown-linux-gnu
- os: macos-latest
artifact: macOS-x86_64
target: x86_64-apple-darwin
- os: macos-latest
artifact: macOS-aarch64
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- id: toolchain
name: Install nightly toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
targets: ${{ matrix.target }}
- 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: ${{ matrix.target }}-release-${{ steps.toolchain.outputs.cachekey }}
- name: Install ALSA
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install libasound2-dev
- name: Update dependencies
run: cargo update
- name: Build release binary (no debugging features)
run: >
cargo build
--verbose
--profile ci
--target ${{ matrix.target }}
--no-default-features
--features=${{ env.RELEASE_FEATURES }}
--package dust-desktop
tar
-C target/${{ matrix.target }}/ci
-cf dust-desktop.tar.gz
dust-desktop${{ matrix.artifact-extension }}
- name: Upload release binary (no debugging features)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dust-desktop.tar.gz
- name: Build release binary (debugging features)
run: >
cargo build
--verbose
--profile ci
--target ${{ matrix.target }}
--no-default-features
--features=${{ env.DEBUG_FEATURES }}
--package dust-desktop
tar
-C target/${{ matrix.target }}/ci
-cf dust-desktop.tar.gz
dust-desktop${{ matrix.artifact-extension }}
- name: Upload release binary (debugging features)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}-debug
path: dust-desktop.tar.gz
- name: Build release binary (debugging features + GDB)
run: >
cargo build
--verbose
--profile ci
--target ${{ matrix.target }}
--no-default-features
--features=${{ env.DEBUG_GDB_FEATURES }}
--package dust-desktop
tar
-C target/${{ matrix.target }}/ci
-cf dust-desktop.tar.gz
dust-desktop${{ matrix.artifact-extension }}
- name: Upload release binary (debugging features + GDB)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}-debug-gdb
path: dust-desktop.tar.gz