@@ -2,60 +2,7 @@ on: [push, pull_request]
2
2
3
3
name : CI
4
4
5
- env :
6
- # This is required to enable the web_sys clipboard API which egui_web uses
7
- # https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
8
- # https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
9
- RUSTFLAGS : --cfg=web_sys_unstable_apis
10
-
11
5
jobs :
12
- check :
13
- name : Check
14
- runs-on : ubuntu-latest
15
- steps :
16
- - uses : actions/checkout@v2
17
- - uses : actions-rs/toolchain@v1
18
- with :
19
- profile : minimal
20
- toolchain : stable
21
- override : true
22
- - uses : actions-rs/cargo@v1
23
- with :
24
- command : check
25
- # args: --all-features
26
-
27
- # check_wasm:
28
- # name: Check wasm32
29
- # runs-on: ubuntu-latest
30
- # steps:
31
- # - uses: actions/checkout@v2
32
- # - uses: actions-rs/toolchain@v1
33
- # with:
34
- # profile: minimal
35
- # toolchain: stable
36
- # target: wasm32-unknown-unknown
37
- # override: true
38
- # - uses: actions-rs/cargo@v1
39
- # with:
40
- # command: check
41
- # args: --all-features --lib --target wasm32-unknown-unknown
42
-
43
- test :
44
- name : Test Suite
45
- runs-on : ubuntu-latest
46
- steps :
47
- - uses : actions/checkout@v2
48
- - uses : actions-rs/toolchain@v1
49
- with :
50
- profile : minimal
51
- toolchain : stable
52
- override : true
53
- - run : sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
54
- - uses : actions-rs/cargo@v1
55
- with :
56
- command : test
57
- args : --lib
58
-
59
6
fmt :
60
7
name : Rustfmt
61
8
runs-on : ubuntu-latest
@@ -83,59 +30,148 @@ jobs:
83
30
toolchain : stable
84
31
override : true
85
32
components : clippy
33
+
34
+ - uses : Swatinem/rust-cache@v2
86
35
- uses : actions-rs/cargo@v1
87
36
with :
88
37
command : clippy
89
38
args : -- -D warnings
90
39
91
- # trunk:
92
- # name: trunk
93
- # runs-on: ubuntu-latest
94
- # steps:
95
- # - uses: actions/checkout@v2
96
- # - uses: actions-rs/toolchain@v1
97
- # with:
98
- # profile: minimal
99
- # toolchain: 1.61.0
100
- # target: wasm32-unknown-unknown
101
- # override: true
102
- # - name: Download and install Trunk binary
103
- # run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
104
- # - name: Build
105
- # run: ./trunk build
106
-
107
- packages :
108
- name : Build Packages
40
+ build-and-test :
41
+ name : Build and Test (${{ matrix.os }})
42
+ runs-on : ${{ matrix.os }}
43
+ strategy :
44
+ matrix :
45
+ os : [ubuntu-latest, windows-latest]
46
+ toolchain : [stable]
47
+ steps :
48
+ # Checkout the repository
49
+ - name : Checkout Code
50
+ uses : actions/checkout@v2
51
+
52
+ # Set up the Rust toolchain
53
+ - name : Setup Rust
54
+ uses : actions-rs/toolchain@v1
55
+ with :
56
+ profile : minimal
57
+ toolchain : ${{ matrix.toolchain }}
58
+ override : true
59
+
60
+ # Cache
61
+ - name : Rust cache
62
+ uses : Swatinem/rust-cache@v2
63
+
64
+ # Install dependencies (only for Ubuntu)
65
+ - name : Install Dependencies (Ubuntu)
66
+ if : runner.os == 'Linux'
67
+ run : sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
68
+
69
+ # Run tests
70
+ - name : Run Tests
71
+ uses : actions-rs/cargo@v1
72
+ with :
73
+ command : test
74
+ args : --release
75
+
76
+ # Build
77
+ - name : Build
78
+ uses : actions-rs/cargo@v1
79
+ with :
80
+ command : build
81
+ args : --release
82
+
83
+ # Strip Debug Symbols
84
+ - name : Strip Debug Symbols
85
+ if : runner.os == 'Linux'
86
+ run : strip target/release/notedeck || echo "Skipping strip if not applicable"
87
+
88
+ # Upload bin for further packaging steps
89
+ - name : Upload Build Artifacts
90
+ if : runner.os == 'Linux'
91
+ uses : actions/upload-artifact@v3
92
+ with :
93
+ name : notedeck-linux-bin
94
+ path : target/release/notedeck
95
+
96
+ # Upload exe for further packaging steps
97
+ - name : Upload Build Artifacts
98
+ if : runner.os == 'Windows'
99
+ uses : actions/upload-artifact@v3
100
+ with :
101
+ name : notedeck-windows-exe
102
+ path : target/release/notedeck.exe
103
+
104
+ packaging :
105
+ name : Build Linux Packages
109
106
runs-on : ubuntu-latest
107
+ needs : build-and-test
110
108
steps :
109
+ # Checkout the repository
111
110
- name : Checkout Code
112
111
uses : actions/checkout@v2
113
112
113
+ # Install Packaging Tools
114
114
- name : Install Packaging Tools
115
115
run : |
116
116
sudo apt-get update
117
117
sudo apt-get install -y rpm binutils
118
118
cargo install cargo-generate-rpm cargo-deb
119
119
120
- - name : Build Project
121
- run : cargo build --release
122
-
123
- - name : Strip Debug Symbols
124
- run : strip target/release/notedeck || echo "Skipping strip if not applicable"
120
+ - name : Download Build Artifacts
121
+ uses : actions/download-artifact@v3
122
+ with :
123
+ name : notedeck-linux-bin # Assuming you need the Release build
125
124
125
+ # Build Packages
126
126
- name : Build Packages
127
127
run : |
128
128
cargo generate-rpm
129
129
cargo deb
130
130
131
+ # Upload RPM Package
131
132
- name : Upload RPM Package
132
133
uses : actions/upload-artifact@v4
133
134
with :
134
135
name : notedeck-rpm
135
136
path : target/generate-rpm/*.rpm
136
137
138
+ # Upload Debian Package
137
139
- name : Upload Debian Package
138
140
uses : actions/upload-artifact@v4
139
141
with :
140
142
name : notedeck-deb
141
143
path : target/debian/*.deb
144
+
145
+ windows-installer :
146
+ name : Build Windows Installer
147
+ runs-on : windows-latest
148
+ needs : build-and-test
149
+ steps :
150
+ # Checkout the repository
151
+ - name : Checkout Code
152
+ uses : actions/checkout@v2
153
+
154
+ - name : Download Build Artifacts
155
+ uses : actions/download-artifact@v3
156
+ with :
157
+ name : notedeck-windows-exe # Assuming you need the Release build
158
+
159
+ # Install Inno Setup
160
+ - name : Install Inno Setup
161
+ run : choco install innosetup --no-progress --yes
162
+
163
+ # Build Installer
164
+ - name : Run Inno Setup Script
165
+ run : |
166
+ "C:\Program Files (x86)\Inno Setup 6\ISCC.exe scripts/windows-installer.iss"
167
+
168
+ # List outputs
169
+ - name : List Inno Script outputs
170
+ run : dir packages
171
+
172
+ # Upload the installer as an artifact
173
+ - name : Upload Installer
174
+ uses : actions/upload-artifact@v3
175
+ with :
176
+ name : Windows-Installer
177
+ path : packages\DamusNotedeckInstaller.exe
0 commit comments