@@ -66,6 +66,180 @@ jobs:
66
66
tag : ${{ github.ref }}
67
67
overwrite : true
68
68
69
+ release-linux :
70
+ runs-on : ubuntu-latest
71
+
72
+ steps :
73
+ -
uses :
olegtarasov/[email protected]
74
+ id : get_version
75
+ - uses : actions/checkout@v4
76
+ - uses : dtolnay/rust-toolchain@stable
77
+ with :
78
+ targets : x86_64-unknown-linux-gnu
79
+ - name : install dependencies
80
+ run : |
81
+ sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
82
+
83
+ - name : Build
84
+ run : |
85
+ cargo build --release --target x86_64-unknown-linux-gnu
86
+
87
+ - name : Prepare package
88
+ run : |
89
+ mkdir linux
90
+ cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/
91
+ cp -r assets linux/
92
+
93
+ - name : Package as a zip
94
+ working-directory : ./linux
95
+ run : |
96
+ zip --recurse-paths ../${{ env.binary }}.zip .
97
+
98
+ - name : Upload binaries to artifacts
99
+ uses : actions/upload-artifact@v3
100
+ with :
101
+ path : ${{ env.binary }}.zip
102
+ name : linux
103
+ retention-days : 1
104
+
105
+ - name : Upload binaries to release
106
+ if : ${{ env.add_binaries_to_github_release == 'true' }}
107
+ uses : svenstaro/upload-release-action@v2
108
+ with :
109
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
110
+ file : ${{ env.binary }}.zip
111
+ asset_name : ${{ env.binary }}-linux-${{ steps.get_version.outputs.tag }}.zip
112
+ tag : ${{ github.ref }}
113
+ overwrite : true
114
+
115
+ release-windows :
116
+ runs-on : windows-latest
117
+
118
+ steps :
119
+ -
uses :
olegtarasov/[email protected]
120
+ id : get_version
121
+ - uses : actions/checkout@v4
122
+ - uses : dtolnay/rust-toolchain@stable
123
+ with :
124
+ targets : x86_64-pc-windows-msvc
125
+
126
+ - name : Build
127
+ run : |
128
+ cargo build --release --target x86_64-pc-windows-msvc
129
+
130
+ - name : Prepare package
131
+ run : |
132
+ mkdir windows
133
+ cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/
134
+ cp -r assets windows/
135
+
136
+ - name : Package as a zip
137
+ run : |
138
+ Compress-Archive -Path windows/* -DestinationPath ${{ env.binary }}.zip
139
+
140
+ - name : Upload binaries to artifacts
141
+ uses : actions/upload-artifact@v3
142
+ with :
143
+ path : ${{ env.binary }}.zip
144
+ name : windows
145
+ retention-days : 1
146
+
147
+ - name : Upload binaries to release
148
+ if : ${{ env.add_binaries_to_github_release == 'true' }}
149
+ uses : svenstaro/upload-release-action@v2
150
+ with :
151
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
152
+ file : ${{ env.binary }}.zip
153
+ asset_name : ${{ env.binary }}-windows-${{ steps.get_version.outputs.tag }}.zip
154
+ tag : ${{ github.ref }}
155
+ overwrite : true
156
+
157
+ release-macOS-intel :
158
+ runs-on : macOS-latest
159
+
160
+ steps :
161
+ -
uses :
olegtarasov/[email protected]
162
+ id : get_version
163
+ - uses : actions/checkout@v4
164
+ - uses : dtolnay/rust-toolchain@stable
165
+ with :
166
+ targets : x86_64-apple-darwin
167
+ - name : Environment Setup
168
+ run : |
169
+ export CFLAGS="-fno-stack-check"
170
+ export MACOSX_DEPLOYMENT_TARGET="10.9"
171
+
172
+ - name : Build
173
+ run : |
174
+ cargo build --release --target x86_64-apple-darwin
175
+
176
+ - name : Prepare Package
177
+ run : |
178
+ mkdir -p ${{ env.binary }}.app/Contents/MacOS
179
+ cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
180
+ cp -r assets ${{ env.binary }}.app/Contents/MacOS/
181
+ hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-intel.dmg
182
+
183
+ - name : Upload binaries to artifacts
184
+ uses : actions/upload-artifact@v3
185
+ with :
186
+ path : ${{ env.binary }}-macOS-intel.dmg
187
+ name : macOS-intel
188
+ retention-days : 1
189
+
190
+ - name : Upload binaries to release
191
+ if : ${{ env.add_binaries_to_github_release == 'true' }}
192
+ uses : svenstaro/upload-release-action@v2
193
+ with :
194
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
195
+ file : ${{ env.binary }}-macOS-intel.dmg
196
+ asset_name : ${{ env.binary }}-macOS-intel-${{ steps.get_version.outputs.tag }}.dmg
197
+ tag : ${{ github.ref }}
198
+ overwrite : true
199
+
200
+ release-macOS-apple-silicon :
201
+ runs-on : macOS-latest
202
+
203
+ steps :
204
+ -
uses :
olegtarasov/[email protected]
205
+ id : get_version
206
+ - uses : actions/checkout@v4
207
+ - uses : dtolnay/rust-toolchain@stable
208
+ with :
209
+ targets : aarch64-apple-darwin
210
+ - name : Environment
211
+ # macOS 11 was the first version to support ARM
212
+ run : |
213
+ export MACOSX_DEPLOYMENT_TARGET="11"
214
+
215
+ - name : Build
216
+ run : |
217
+ cargo build --release --target aarch64-apple-darwin
218
+
219
+ - name : Prepare Package
220
+ run : |
221
+ mkdir -p ${{ env.binary }}.app/Contents/MacOS
222
+ cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
223
+ cp -r assets ${{ env.binary }}.app/Contents/MacOS/
224
+ hdiutil create -fs HFS+ -volname "${{ env.binary }}-macOS-apple-silicon" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-apple-silicon.dmg
225
+
226
+ - name : Upload binaries to artifacts
227
+ uses : actions/upload-artifact@v3
228
+ with :
229
+ path : ${{ env.binary }}-macOS-apple-silicon.dmg
230
+ name : macOS-apple-silicon
231
+ retention-days : 1
232
+
233
+ - name : Upload binaries to release
234
+ if : ${{ env.add_binaries_to_github_release == 'true' }}
235
+ uses : svenstaro/upload-release-action@v2
236
+ with :
237
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
238
+ file : ${{ env.binary }}-macOS-apple-silicon.dmg
239
+ asset_name : ${{ env.binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg
240
+ tag : ${{ github.ref }}
241
+ overwrite : true
242
+
69
243
check-if-upload-to-itch-is-configured :
70
244
runs-on : ubuntu-latest
71
245
outputs :
@@ -84,6 +258,10 @@ jobs:
84
258
needs :
85
259
- check-if-upload-to-itch-is-configured
86
260
- release-wasm
261
+ - release-linux
262
+ - release-windows
263
+ - release-macOS-intel
264
+ - release-macOS-apple-silicon
87
265
if : ${{ needs.check-if-upload-to-itch-is-configured.outputs.should-upload == 'yes' }}
88
266
89
267
steps :
0 commit comments