@@ -30,37 +30,37 @@ jobs:
30
30
components : clippy
31
31
- run : cargo clippy -- -D warnings
32
32
33
- linux-build- test :
34
- name : Build and Test (Linux)
33
+ linux-test :
34
+ name : Test (Linux)
35
35
uses : ./.github/workflows/build-and-test.yml
36
36
with :
37
37
os : ubuntu-latest
38
- upload-artifact-name : notedeck-linux-bin
39
- upload-artifact-path : target/release/notedeck
40
38
additional-setup : |
41
39
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
42
40
43
- macos-build- test :
44
- name : Build and Test (macOS)
41
+ macos-test :
42
+ name : Test (macOS)
45
43
uses : ./.github/workflows/build-and-test.yml
46
44
with :
47
45
os : macos-latest
48
- upload-artifact-name : notedeck-macos-bin
49
- upload-artifact-path : target/release/notedeck
50
46
51
- windows-build- test :
52
- name : Build and Test (Windows)
47
+ windows-test :
48
+ name : Test (Windows)
53
49
uses : ./.github/workflows/build-and-test.yml
54
50
with :
55
51
os : windows-latest
56
- upload-artifact-name : notedeck.exe
57
- upload-artifact-path : target/release/notedeck.exe
58
52
59
53
packaging :
60
- name : Build Linux Packages
54
+ name : rpm/deb
61
55
runs-on : ubuntu-latest
62
- needs : linux-build-test
63
- if : github.ref_name == 'master'
56
+ needs : linux-test
57
+ # if: github.ref_name == 'master'
58
+
59
+ strategy :
60
+ fail-fast : false
61
+ matrix :
62
+ arch : [x86_64, aarch64]
63
+
64
64
steps :
65
65
# Checkout the repository
66
66
- name : Checkout Code
@@ -70,69 +70,80 @@ jobs:
70
70
- name : Install Packaging Tools
71
71
run : |
72
72
sudo apt-get update
73
- sudo apt-get install -y rpm binutils
73
+ if [ "${{ matrix.arch }}" != "$(uname -m)" ]; then
74
+ sudo apt-get install -y gcc-${{ matrix.arch }}-linux-gnu g++-aarch64-linux-gnu
75
+ rustup target add ${{ matrix.arch }}-unknown-linux-gnu
76
+ fi
74
77
cargo install cargo-generate-rpm cargo-deb
75
78
76
- # download!
77
- - name : Download Build Artifacts
78
- uses : actions/download-artifact@v4
79
- with :
80
- name : notedeck-linux-bin
81
- path : target/release
82
-
83
- # Build Packages
84
- - name : Build Packages
79
+ # Build
80
+ - name : Build (${{ matrix.arch }})
81
+ run : |
82
+ echo "arch: $(uname -m)"
83
+ if [ "${{ matrix.arch }}" != "$(uname -m)" ]; then
84
+ cargo build --release --target=${{ matrix.arch }}-unknown-linux-gnu
85
+ else
86
+ cargo build --release
87
+ fi
88
+
89
+ # Build RPM Package
90
+ - name : Build RPM Package
91
+ run : |
92
+ if [ "${{ matrix.arch }}" != "$(uname -m)" ]; then
93
+ cargo generate-rpm --target=${{ matrix.arch }}-unknown-linux-gnu
94
+ else
95
+ cargo generate-rpm
96
+ fi
97
+
98
+ # Build Debian Package
99
+ - name : Build Debian Package
85
100
run : |
86
- cargo generate-rpm
87
- cargo deb
101
+ if [ "${{ matrix.arch }}" != "$(uname -m)" ]; then
102
+ cargo deb --target=${{ matrix.arch }}-unknown-linux-gnu
103
+ else
104
+ cargo deb
105
+ fi
88
106
89
107
# Upload RPM Package
90
108
- name : Upload RPM Package
91
109
uses : actions/upload-artifact@v4
92
110
with :
93
- name : notedeck .rpm
94
- path : target/generate-rpm/*.rpm
111
+ name : ${{ inputs.artifact-name }}-${{ matrix.arch }} .rpm
112
+ path : target/${{ matrix.arch }}-unknown-linux-gnu/ generate-rpm/*.rpm
95
113
96
114
# Upload Debian Package
97
115
- name : Upload Debian Package
98
116
uses : actions/upload-artifact@v4
99
117
with :
100
- name : notedeck .deb
101
- path : target/debian/*.deb
118
+ name : ${{ inputs.artifact-name }}-${{ inputs.arch }} .deb
119
+ path : target/${{ matrix.arch }}-unknown-linux-gnu/ debian/*.deb
102
120
103
121
macos-dmg :
104
- name : Build macOS DMG
122
+ name : macOS dmg
105
123
runs-on : macos-latest
106
- needs : macos-build- test
107
- if : github.ref_name == 'master'
124
+ needs : macos-test
125
+ # if: github.ref_name == 'master'
108
126
env :
109
127
NOTEDECK_APPLE_RELEASE_CERT_ID : ${{ secrets.NOTEDECK_APPLE_RELEASE_CERT_ID }}
110
128
NOTEDECK_RELEASE_APPLE_ID : ${{ secrets.NOTEDECK_RELEASE_APPLE_ID }}
111
129
NOTEDECK_APPLE_APP_SPECIFIC_PW : ${{ secrets.NOTEDECK_APPLE_APP_SPECIFIC_PW }}
112
130
NOTEDECK_APPLE_TEAM_ID : ${{ secrets.NOTEDECK_APPLE_TEAM_ID }}
131
+
132
+ strategy :
133
+ fail-fast : false
134
+ matrix :
135
+ arch : [x86_64, aarch64]
136
+
113
137
steps :
114
138
# Checkout the repository
115
139
- name : Checkout Code
116
140
uses : actions/checkout@v4
117
141
118
- # Set up Rust
119
- - name : Setup Rust
120
- uses : dtolnay/rust-toolchain@stable
121
-
122
- # create-dmg and cargo-bundle caching
123
- - name : Rust cache
124
- uses : Swatinem/rust-cache@v2
125
-
126
- - name : Download Build Artifacts (MacOS)
127
- uses : actions/download-artifact@v4
128
- with :
129
- name : notedeck-macos-bin # Assuming you need the Release build
130
- path : target/release
131
-
132
142
- name : Install Required Tools
133
143
run : |
134
144
brew install create-dmg
135
145
cargo install cargo-bundle
146
+ rustup target add ${{ matrix.arch }}-apple-darwin
136
147
137
148
- name : Import apple codesign cert
138
149
uses : apple-actions/import-codesign-certs@v3
@@ -141,30 +152,28 @@ jobs:
141
152
p12-password : ${{ secrets.CERTIFICATES_P12_PASSWORD }}
142
153
143
154
- name : Run macOS DMG Build Script
144
- run : ./scripts/macos_build.sh
155
+ run : ARCH=${{ matrix.arch }} ./scripts/macos_build.sh
145
156
146
157
- name : Upload DMG Artifact
147
158
uses : actions/upload-artifact@v4
148
159
with :
149
- name : notedeck.dmg
150
- path : packages/notedeck.dmg
160
+ name : notedeck-${{ matrix.arch }} .dmg
161
+ path : packages/notedeck-${{ matrix.arch }} .dmg
151
162
152
163
windows-installer :
153
- name : Build Windows Installer
164
+ name : Windows Installer
154
165
runs-on : windows-latest
155
- needs : windows-build-test
156
- if : github.ref_name == 'master'
166
+ needs : windows-test
167
+ strategy :
168
+ fail-fast : false
169
+ matrix :
170
+ arch : [x86_64, aarch64]
171
+
157
172
steps :
158
173
# Checkout the repository
159
174
- name : Checkout Code
160
175
uses : actions/checkout@v4
161
176
162
- - name : Download Build Artifacts
163
- uses : actions/download-artifact@v4
164
- with :
165
- name : notedeck.exe # Assuming you need the Release build
166
- path : target/release
167
-
168
177
# Create packages directory
169
178
- name : Create packages directory
170
179
run : mkdir packages
@@ -173,25 +182,59 @@ jobs:
173
182
- name : Install Inno Setup
174
183
run : choco install innosetup --no-progress --yes
175
184
176
- # Validate executable exists
177
- - name : Validate required files
185
+ # Set up Rust toolchain
186
+ - name : Install Rust toolchain
187
+ run : rustup target add ${{ matrix.arch }}-pc-windows-msvc
188
+
189
+ # Build
190
+ - name : Build
191
+ shell : pwsh
178
192
run : |
179
- if (!(Test-Path -Path target\release\notedeck.exe)) {
180
- throw "Executable 'notedeck.exe' not found in 'target/release'."
181
- }
193
+ $target = "${{ matrix.arch }}-pc-windows-msvc"
194
+ Write-Output "Building for target: $target"
195
+ cargo build --release --target=$target
196
+
197
+ # Generate ISS Script
198
+ - name : Generate Inno Setup Script
199
+ shell : pwsh
200
+ run : |
201
+ $arch = "${{ matrix.arch }}"
202
+ $issContent = @"
203
+ [Setup]
204
+ AppName=Damus Notedeck
205
+ AppVersion=0.1
206
+ DefaultDirName={pf}\Notedeck
207
+ DefaultGroupName=Damus Notedeck
208
+ OutputDir=..\packages\$arch
209
+ OutputBaseFilename=DamusNotedeckInstaller
210
+ Compression=lzma
211
+ SolidCompression=yes
212
+
213
+ [Files]
214
+ Source: "..\target\$arch-pc-windows-msvc\release\notedeck.exe"; DestDir: "{app}"; Flags: ignoreversion
215
+
216
+ [Icons]
217
+ Name: "{group}\Damus Notedeck"; Filename: "{app}\notedeck.exe"
218
+
219
+ [Run]
220
+ Filename: "{app}\notedeck.exe"; Description: "Launch Damus Notedeck"; Flags: nowait postinstall skipifsilent
221
+ "@
222
+ Set-Content -Path "scripts/windows-installer-$arch.iss" -Value $issContent
182
223
183
224
# Build Installer
184
225
- name : Run Inno Setup Script
185
226
run : |
186
- & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "scripts\windows-installer.iss"
187
-
188
- # List outputs
189
- - name : List Inno Script outputs
190
- run : dir packages
227
+ & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "scripts\windows-installer-${{ matrix.arch }}.iss"
191
228
229
+ # Move output
230
+ - name : Move Inno Script outputs to architecture-specific folder
231
+ run : |
232
+ New-Item -ItemType Directory -Force -Path packages\${{ matrix.arch }}
233
+ Move-Item -Path packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe -Destination packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe
192
234
# Upload the installer as an artifact
193
235
- name : Upload Installer
194
236
uses : actions/upload-artifact@v4
195
237
with :
196
- name : DamusNotedeckInstaller.exe
197
- path : packages\DamusNotedeckInstaller.exe
238
+ name : DamusNotedeckInstaller-${{ matrix.arch }}.exe
239
+ path : packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe
240
+
0 commit comments