@@ -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
85
91
run : |
86
- cargo generate-rpm
87
- cargo deb
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
100
+ run : |
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,24 @@ 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
164
name : Build Windows Installer
154
165
runs-on : windows-latest
155
- needs : windows-build- test
156
- if : github.ref_name == 'master'
166
+ needs : windows-test
167
+ # if: github.ref_name == 'master'
157
168
steps :
158
169
# Checkout the repository
159
170
- name : Checkout Code
160
171
uses : actions/checkout@v4
161
172
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
173
# Create packages directory
169
174
- name : Create packages directory
170
175
run : mkdir packages
@@ -173,13 +178,6 @@ jobs:
173
178
- name : Install Inno Setup
174
179
run : choco install innosetup --no-progress --yes
175
180
176
- # Validate executable exists
177
- - name : Validate required files
178
- run : |
179
- if (!(Test-Path -Path target\release\notedeck.exe)) {
180
- throw "Executable 'notedeck.exe' not found in 'target/release'."
181
- }
182
-
183
181
# Build Installer
184
182
- name : Run Inno Setup Script
185
183
run : |
@@ -195,3 +193,4 @@ jobs:
195
193
with :
196
194
name : DamusNotedeckInstaller.exe
197
195
path : packages\DamusNotedeckInstaller.exe
196
+
0 commit comments