@@ -8,13 +8,15 @@ name: Release
8
8
on : [push]
9
9
10
10
env :
11
- binary : client
12
11
add_binaries_to_github_release : true
13
12
use_git_lfs : true
14
13
15
14
jobs :
16
15
release-linux :
17
16
runs-on : ubuntu-latest
17
+ strategy :
18
+ matrix :
19
+ binary : [client, server]
18
20
19
21
steps :
20
22
- uses : olegtarasov/get-tag@v2.1.2
@@ -31,38 +33,41 @@ jobs:
31
33
32
34
- name : Build
33
35
run : |
34
- cargo build --release --target x86_64-unknown-linux-gnu
36
+ cargo build --release --target x86_64-unknown-linux-gnu --bin ${{ matrix.binary }}
35
37
36
38
- name : Prepare package
37
39
run : |
38
40
mkdir linux
39
- cp target/x86_64-unknown-linux-gnu/release/${{ env .binary }} linux/
41
+ cp target/x86_64-unknown-linux-gnu/release/${{ matrix .binary }} linux/
40
42
cp -r assets linux/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
41
43
42
44
- name : Package as a zip
43
45
working-directory : ./linux
44
46
run : |
45
- zip --recurse-paths ../${{ env .binary }}.zip .
47
+ zip --recurse-paths ../${{ matrix .binary }}.zip .
46
48
47
49
- name : Upload binaries to artifacts
48
50
uses : actions/upload-artifact@v3
49
51
with :
50
- path : ${{ env .binary }}.zip
51
- name : linux
52
+ path : ${{ matrix .binary }}.zip
53
+ name : linux-${{ matrix.binary }}
52
54
retention-days : 1
53
55
54
56
- name : Upload binaries to release
55
57
if : ${{ env.add_binaries_to_github_release == 'true' }}
56
58
uses : svenstaro/upload-release-action@v2
57
59
with :
58
60
repo_token : ${{ secrets.GITHUB_TOKEN }}
59
- file : ${{ env .binary }}.zip
60
- asset_name : ${{ env .binary }}-linux-${{ steps.get_version.outputs.tag }}.zip
61
+ file : ${{ matrix .binary }}.zip
62
+ asset_name : ${{ matrix .binary }}-linux-${{ steps.get_version.outputs.tag }}.zip
61
63
tag : ${{ github.ref }}
62
64
overwrite : true
63
65
64
66
release-windows :
65
67
runs-on : windows-latest
68
+ strategy :
69
+ matrix :
70
+ binary : [client, server]
66
71
67
72
steps :
68
73
- uses : olegtarasov/get-tag@v2.1.2
@@ -76,38 +81,41 @@ jobs:
76
81
77
82
- name : Build
78
83
run : |
79
- cargo build --release --target x86_64-pc-windows-msvc
84
+ cargo build --release --target x86_64-pc-windows-msvc --bin ${{ matrix.binary }}
80
85
81
86
- name : Prepare package
82
87
run : |
83
88
mkdir windows
84
- cp target/x86_64-pc-windows-msvc/release/${{ env .binary }}.exe windows/
89
+ cp target/x86_64-pc-windows-msvc/release/${{ matrix .binary }}.exe windows/
85
90
mkdir assets -ea 0 # create the assets directory if it does not exist, it will get ignored in the zip if empty
86
91
cp -r assets windows/
87
92
88
93
- name : Package as a zip
89
94
run : |
90
- Compress-Archive -Path windows/* -DestinationPath ${{ env .binary }}.zip
95
+ Compress-Archive -Path windows/* -DestinationPath ${{ matrix .binary }}.zip
91
96
92
97
- name : Upload binaries to artifacts
93
98
uses : actions/upload-artifact@v3
94
99
with :
95
- path : ${{ env .binary }}.zip
96
- name : windows
100
+ path : ${{ matrix .binary }}.zip
101
+ name : windows-${{ matrix.binary }}
97
102
retention-days : 1
98
103
99
104
- name : Upload binaries to release
100
105
if : ${{ env.add_binaries_to_github_release == 'true' }}
101
106
uses : svenstaro/upload-release-action@v2
102
107
with :
103
108
repo_token : ${{ secrets.GITHUB_TOKEN }}
104
- file : ${{ env .binary }}.zip
105
- asset_name : ${{ env .binary }}-windows-${{ steps.get_version.outputs.tag }}.zip
109
+ file : ${{ matrix .binary }}.zip
110
+ asset_name : ${{ matrix .binary }}-windows-${{ steps.get_version.outputs.tag }}.zip
106
111
tag : ${{ github.ref }}
107
112
overwrite : true
108
113
109
114
release-macOS-intel :
110
115
runs-on : macOS-latest
116
+ strategy :
117
+ matrix :
118
+ binary : [client, server]
111
119
112
120
steps :
113
121
- uses : olegtarasov/get-tag@v2.1.2
@@ -125,34 +133,37 @@ jobs:
125
133
126
134
- name : Build
127
135
run : |
128
- cargo build --release --target x86_64-apple-darwin
136
+ cargo build --release --target x86_64-apple-darwin --bin ${{ matrix.binary }}
129
137
130
138
- name : Prepare Package
131
139
run : |
132
- mkdir -p ${{ env .binary }}.app/Contents/MacOS
133
- cp target/x86_64-apple-darwin/release/${{ env .binary }} ${{ env .binary }}.app/Contents/MacOS/
134
- cp -r assets ${{ env .binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
135
- hdiutil create -fs HFS+ -volname "${{ env .binary }}" -srcfolder ${{ env .binary }}.app ${{ env .binary }}-macOS-intel.dmg
140
+ mkdir -p ${{ matrix .binary }}.app/Contents/MacOS
141
+ cp target/x86_64-apple-darwin/release/${{ matrix .binary }} ${{ matrix .binary }}.app/Contents/MacOS/
142
+ cp -r assets ${{ matrix .binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
143
+ hdiutil create -fs HFS+ -volname "${{ matrix .binary }}" -srcfolder ${{ matrix .binary }}.app ${{ matrix .binary }}-macOS-intel.dmg
136
144
137
145
- name : Upload binaries to artifacts
138
146
uses : actions/upload-artifact@v3
139
147
with :
140
- path : ${{ env .binary }}-macOS-intel.dmg
141
- name : macOS-intel
148
+ path : ${{ matrix .binary }}-macOS-intel.dmg
149
+ name : macOS-intel-${{ matrix.binary }}
142
150
retention-days : 1
143
151
144
152
- name : Upload binaries to release
145
153
if : ${{ env.add_binaries_to_github_release == 'true' }}
146
154
uses : svenstaro/upload-release-action@v2
147
155
with :
148
156
repo_token : ${{ secrets.GITHUB_TOKEN }}
149
- file : ${{ env .binary }}-macOS-intel.dmg
150
- asset_name : ${{ env .binary }}-macOS-intel-${{ steps.get_version.outputs.tag }}.dmg
157
+ file : ${{ matrix .binary }}-macOS-intel.dmg
158
+ asset_name : ${{ matrix .binary }}-macOS-intel-${{ steps.get_version.outputs.tag }}.dmg
151
159
tag : ${{ github.ref }}
152
160
overwrite : true
153
161
154
162
release-macOS-apple-silicon :
155
163
runs-on : macOS-latest
164
+ strategy :
165
+ matrix :
166
+ binary : [client, server]
156
167
157
168
steps :
158
169
- uses : olegtarasov/get-tag@v2.1.2
@@ -169,33 +180,33 @@ jobs:
169
180
170
181
- name : Build
171
182
run : |
172
- cargo build --release --target aarch64-apple-darwin
183
+ cargo build --release --target aarch64-apple-darwin --bin ${{ matrix.binary }}
173
184
174
185
- name : Prepare Package
175
186
run : |
176
- mkdir -p ${{ env .binary }}.app/Contents/MacOS
177
- cp target/aarch64-apple-darwin/release/${{ env .binary }} ${{ env .binary }}.app/Contents/MacOS/
178
- cp -r assets ${{ env .binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
187
+ mkdir -p ${{ matrix .binary }}.app/Contents/MacOS
188
+ cp target/aarch64-apple-darwin/release/${{ matrix .binary }} ${{ matrix .binary }}.app/Contents/MacOS/
189
+ cp -r assets ${{ matrix .binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
179
190
- name : Create DMG
180
191
run : |
181
- hdiutil create -fs HFS+ -volname "${{ env .binary }}-macOS-apple-silicon" -srcfolder ${{ env .binary }}.app ${{ env .binary }}-macOS-apple-silicon.dmg
192
+ hdiutil create -fs HFS+ -volname "${{ matrix .binary }}-macOS-apple-silicon" -srcfolder ${{ matrix .binary }}.app ${{ matrix .binary }}-macOS-apple-silicon.dmg
182
193
183
194
- name : Verify DMG
184
195
run : |
185
- hdiutil verify ${{ env .binary }}-macOS-apple-silicon.dmg
196
+ hdiutil verify ${{ matrix .binary }}-macOS-apple-silicon.dmg
186
197
- name : Upload binaries to artifacts
187
198
uses : actions/upload-artifact@v3
188
199
with :
189
- path : ${{ env .binary }}-macOS-apple-silicon.dmg
190
- name : macOS-apple-silicon
200
+ path : ${{ matrix .binary }}-macOS-apple-silicon.dmg
201
+ name : macOS-apple-silicon-${{ matrix.binary }}
191
202
retention-days : 1
192
203
193
204
- name : Upload binaries to release
194
205
if : ${{ env.add_binaries_to_github_release == 'true' }}
195
206
uses : svenstaro/upload-release-action@v2
196
207
with :
197
208
repo_token : ${{ secrets.GITHUB_TOKEN }}
198
- file : ${{ env .binary }}-macOS-apple-silicon.dmg
199
- asset_name : ${{ env .binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg
209
+ file : ${{ matrix .binary }}-macOS-apple-silicon.dmg
210
+ asset_name : ${{ matrix .binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg
200
211
tag : ${{ github.ref }}
201
212
overwrite : true
0 commit comments