13
13
name : build
14
14
runs-on : ${{ matrix.os }}
15
15
env :
16
- # For some builds, we use cross to test on 32-bit and big-endian
17
- # systems.
18
16
CARGO : cargo
19
- # When CARGO is set to CROSS, this is set to `--target matrix.target`.
20
- TARGET_FLAGS : ' '
21
- # When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
22
- TARGET_DIR : ./target
23
- # Bump this as appropriate. We pin to a version to make sure CI
24
- # continues to work as cross releases in the past have broken things
25
- # in subtle ways.
26
- CROSS_VERSION : v0.2.5
27
17
# Emit backtraces on panics.
28
18
RUST_BACKTRACE : 1
29
19
strategy :
@@ -33,29 +23,23 @@ jobs:
33
23
- build : linux
34
24
os : ubuntu-latest
35
25
rust : stable
36
- target : x86_64-unknown-linux-musl
37
- strip : x86_64-linux-musl-strip
38
- - build : stable-x86
39
- os : ubuntu-latest
40
- rust : stable
41
- target : i686-unknown-linux-gnu
42
- strip : x86_64-linux-gnu-strip
26
+ target : x86_64-unknown-linux-gnu
43
27
- build : macos
44
28
os : macos-latest
45
- rust : nightly
29
+ rust : stable
46
30
target : x86_64-apple-darwin
47
- - build : win-msvc
31
+ - build : macos
32
+ os : macos-latest
33
+ rust : stable
34
+ target : aarch64-apple-darwin
35
+ - build : win64-msvc
48
36
os : windows-latest
49
- rust : nightly
37
+ rust : stsable-x86_64-gnu
50
38
target : x86_64-pc-windows-msvc
51
- - build : win -gnu
39
+ - build : win64 -gnu
52
40
os : windows-latest
53
- rust : nightly-x86_64-gnu
41
+ rust : stable
54
42
target : x86_64-pc-windows-gnu
55
- - build : win32-msvc
56
- os : windows-latest
57
- rust : nightly
58
- target : i686-pc-windows-msvc
59
43
60
44
steps :
61
45
- name : Checkout repository
@@ -66,65 +50,28 @@ jobs:
66
50
with :
67
51
toolchain : ${{ matrix.rust }}
68
52
target : ${{ matrix.target }}
69
- - name : Use Cross
70
- if : matrix.os == 'ubuntu-latest' && matrix.target != ''
71
- shell : bash
72
- run : |
73
- # In the past, new releases of 'cross' have broken CI. So for now, we
74
- # pin it. We also use their pre-compiled binary releases because cross
75
- # has over 100 dependencies and takes a bit to compile.
76
- dir="$RUNNER_TEMP/cross-download"
77
- mkdir "$dir"
78
- echo "$dir" >> $GITHUB_PATH
79
- cd "$dir"
80
- curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
81
- tar xf cross-x86_64-unknown-linux-musl.tar.gz
82
- echo "CARGO=cross" >> $GITHUB_ENV
83
53
84
- - name : Set target variables
54
+ - name : Build applications
85
55
shell : bash
86
56
run : |
87
- echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
88
- echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
89
-
90
- - name : Show command used for Cargo
91
- shell : bash
92
- run : |
93
- echo "cargo command is: ${{ env.CARGO }}"
94
- echo "target flag is: ${{ env.TARGET_FLAGS }}"
95
- echo "target dir is: ${{ env.TARGET_DIR }}"
96
-
97
- - name : Build release binary
98
- shell : bash
99
- run : |
100
- ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}
57
+ CARGO_PROFILE_RELEASE_STRIP=symbols ${{ env.CARGO }} build \
58
+ --verbose \
59
+ --target ${{ matrix.target }} \
60
+ --all-features \
61
+ --release \
62
+ -p cggtts-cli
63
+ ls -lah target/${{ matrix.target }}/release
101
64
if [ "${{ matrix.os }}" = "windows-latest" ]; then
102
65
bin="target/${{ matrix.target }}/release/cggtts-cli.exe"
103
66
else
104
67
bin="target/${{ matrix.target }}/release/cggtts-cli"
105
68
fi
106
69
echo "BIN=$bin" >> $GITHUB_ENV
107
70
108
- - name : Strip release binary (macos)
109
- if : matrix.os == 'macos-latest'
110
- shell : bash
111
- run : strip "$BIN"
112
-
113
- - name : Strip release binary (cross)
114
- if : env.CARGO == 'cross'
115
- shell : bash
116
- run : |
117
- docker run --rm -v \
118
- "$PWD/target:/target:Z" \
119
- "rustembedded/cross:${{ matrix.target }}" \
120
- "${{ matrix.strip }}" \
121
- "/target/${{ matrix.target }}/release/cggtts-cli"
122
-
123
71
- name : Determine archive name
124
72
shell : bash
125
73
run : |
126
- version="${{ needs.create-release.outputs.version }}"
127
- echo "ARCHIVE=cggtts-cli-$version-${{ matrix.target }}" >> $GITHUB_ENV
74
+ echo "ARCHIVE=cggtts-cli-${{ github.ref_name }}-${{ matrix.target }}" >> $GITHUB_ENV
128
75
129
76
- name : Creating directory for archive
130
77
shell : bash
133
80
cp "$BIN" "$ARCHIVE"/
134
81
cp {README.md,LICENSE-MIT,LICENSE-APACHE} "$ARCHIVE"/
135
82
136
- - name : Build archive (Unix)
83
+ - name : Gzip archive (Unix)
137
84
shell : bash
138
85
if : matrix.os != 'windows-latest'
139
86
run : |
142
89
echo "ASSET=$ARCHIVE.tar.gz" >> $GITHUB_ENV
143
90
echo "ASSET_SUM=$ARCHIVE.tar.gz.sha256" >> $GITHUB_ENV
144
91
145
- - name : Build archive (Windows)
92
+ - name : Zip archive (Windows)
146
93
shell : bash
147
94
if : matrix.os == 'windows-latest'
148
95
run : |
@@ -173,93 +120,77 @@ jobs:
173
120
tag_name : ${{ github.ref_name }}
174
121
release_name : ${{ github.ref_name }}
175
122
176
- - name : Download linux-stable (musl)
123
+ - name : Download linux-stable
177
124
uses : actions/download-artifact@v3
178
125
with :
179
- name : cggtts-cli--x86_64-unknown-linux-musl .tar.gz
126
+ name : cggtts-cli-${{ github.ref_name }} -x86_64-unknown-linux-gnu .tar.gz
180
127
181
- - name : Upload linux-stable (musl)
128
+ - name : Upload linux-stable
182
129
uses : actions/upload-release-asset@v1
183
130
env :
184
131
GITHUB_TOKEN : ${{ github.token }}
185
132
with :
186
133
upload_url : ${{ steps.create_release.outputs.upload_url }}
187
- asset_path : cggtts-cli--x86_64-unknown-linux-musl .tar.gz
188
- asset_name : cggtts-cli-x86_x64-linux-musl .tar.gz
134
+ asset_path : cggtts-cli-${{ github.ref_name }} -x86_64-unknown-linux-gnu .tar.gz
135
+ asset_name : cggtts-cli-x86_x64-linux-gnu .tar.gz
189
136
asset_content_type : application/gzip
190
137
191
- - name : Download linux-stable (i686)
138
+ - name : Download macos-latest
192
139
uses : actions/download-artifact@v3
193
140
with :
194
- name : cggtts-cli--i686-unknown-linux-gnu .tar.gz
141
+ name : cggtts-cli-${{ github.ref_name }}-x86_64-apple-darwin .tar.gz
195
142
196
- - name : Upload linux-stable (i686)
143
+ - name : Upload macos-latest
197
144
uses : actions/upload-release-asset@v1
198
145
env :
199
146
GITHUB_TOKEN : ${{ github.token }}
200
147
with :
201
148
upload_url : ${{ steps.create_release.outputs.upload_url }}
202
- asset_path : cggtts-cli--i686-unknown-linux-gnu .tar.gz
203
- asset_name : cggtts-cli-i686-linux-gnu .tar.gz
149
+ asset_path : cggtts-cli-${{ github.ref_name }}-x86_64-apple-darwin .tar.gz
150
+ asset_name : cggtts-cli-x86_64-apple-darwin .tar.gz
204
151
asset_content_type : application/gzip
205
-
206
- - name : Download macos-latest
152
+
153
+ - name : Download macos-latest (aarch64)
207
154
uses : actions/download-artifact@v3
208
155
with :
209
- name : cggtts-cli--x86_64 -apple-darwin.tar.gz
156
+ name : cggtts-cli-${{ github.ref_name }}-aarch64 -apple-darwin.tar.gz
210
157
211
158
- name : Upload macos-latest
212
159
uses : actions/upload-release-asset@v1
213
160
env :
214
161
GITHUB_TOKEN : ${{ github.token }}
215
162
with :
216
163
upload_url : ${{ steps.create_release.outputs.upload_url }}
217
- asset_path : cggtts-cli--x86_64 -apple-darwin.tar.gz
218
- asset_name : cggtts-cli--x86_64 -apple-darwin.tar.gz
164
+ asset_path : cggtts-cli-${{ github.ref_name }}-aarch64 -apple-darwin.tar.gz
165
+ asset_name : cggtts-cli-aarch64 -apple-darwin.tar.gz
219
166
asset_content_type : application/gzip
220
167
221
- - name : Download windows i686
222
- uses : actions/download-artifact@v3
223
- with :
224
- name : cggtts-cli--i686-pc-windows-msvc.zip
225
-
226
- - name : Upload windows i686
227
- uses : actions/upload-release-asset@v1
228
- env :
229
- GITHUB_TOKEN : ${{ github.token }}
230
- with :
231
- upload_url : ${{ steps.create_release.outputs.upload_url }}
232
- asset_path : cggtts-cli--i686-pc-windows-msvc.zip
233
- asset_name : cggtts-cli--i686-pc-windows-msvc.zip
234
- asset_content_type : application/zip
235
-
236
168
- name : Download windows x86_64 (msvc)
237
169
uses : actions/download-artifact@v3
238
170
with :
239
- name : cggtts-cli--x86_64-pc-windows-msvc.zip
171
+ name : cggtts-cli-${{ github.ref_name }} -x86_64-pc-windows-msvc.zip
240
172
241
173
- name : Download windows x86_64 (msvc)
242
174
uses : actions/upload-release-asset@v1
243
175
env :
244
176
GITHUB_TOKEN : ${{ github.token }}
245
177
with :
246
178
upload_url : ${{ steps.create_release.outputs.upload_url }}
247
- asset_path : cggtts-cli--x86_64-pc-windows-msvc.zip
248
- asset_name : cggtts-cli-- x86_64-pc-windows-msvc.zip
179
+ asset_path : cggtts-cli-${{ github.ref_name }} -x86_64-pc-windows-msvc.zip
180
+ asset_name : cggtts-cli-x86_64-pc-windows-msvc.zip
249
181
asset_content_type : application/zip
250
182
251
183
- name : Download windows x86_64 (gnu)
252
184
uses : actions/download-artifact@v3
253
185
with :
254
- name : cggtts-cli--x86_64-pc-windows-gnu.zip
186
+ name : cggtts-cli-${{ github.ref_name }} -x86_64-pc-windows-gnu.zip
255
187
256
188
- name : Download windows x86_64 (msvc)
257
189
uses : actions/upload-release-asset@v1
258
190
env :
259
191
GITHUB_TOKEN : ${{ github.token }}
260
192
with :
261
193
upload_url : ${{ steps.create_release.outputs.upload_url }}
262
- asset_path : cggtts-cli--x86_64-pc-windows-gnu.zip
263
- asset_name : cggtts-cli-- x86_64-pc-windows-gnu.zip
194
+ asset_path : cggtts-cli-${{ github.ref_name }} -x86_64-pc-windows-gnu.zip
195
+ asset_name : cggtts-cli-x86_64-pc-windows-gnu.zip
264
196
asset_content_type : application/zip
265
-
0 commit comments