@@ -62,35 +62,30 @@ jobs:
62
62
# Windows ( MinGW )
63
63
- { target: x86_64-pc-windows-gnu, os: windows-2019 }
64
64
# Windows ( MSVC )
65
- - { target: i686-pc-windows-msvc, os: windows-2019 }
66
- - { target: x86_64-pc-windows-msvc, os: windows-2019 }
65
+ - { target: i686-pc-windows-msvc, os: windows-2019, test: true }
66
+ - { target: x86_64-pc-windows-msvc, os: windows-2019, test: true }
67
67
# macOS
68
- - { target: aarch64-apple-darwin, os: macos-15 }
69
- - { target: x86_64-apple-darwin, os: macos-15 }
70
- # *BSD
68
+ - { target: aarch64-apple-darwin, os: macos-15, test: true }
69
+ - { target: x86_64-apple-darwin, os: macos-15, test: true }
70
+ # FreeBSD
71
71
- { target: i686-unknown-freebsd, os: ubuntu-20.04 }
72
72
- { target: x86_64-unknown-freebsd, os: ubuntu-20.04 }
73
- - { target: x86_64-unknown-netbsd, os: ubuntu-20.04 }
74
73
# Linux
75
- - { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04 }
74
+ - { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04, test: true }
76
75
- { target: arm-unknown-linux-gnueabi, os: ubuntu-20.04 }
77
76
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-20.04 }
78
77
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-20.04 }
79
78
- { target: arm-unknown-linux-musleabi, os: ubuntu-20.04 }
80
79
- { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04 }
81
80
- { target: armv7-unknown-linux-musleabihf, os: ubuntu-20.04 }
82
- - { target: i686-unknown-linux-gnu, os: ubuntu-20.04 }
83
- - { target: i686-unknown-linux-musl, os: ubuntu-20.04 }
84
- - { target: mips-unknown-linux-gnu, os: ubuntu-20.04, nightly: true }
85
- - { target: mips64-unknown-linux-gnuabi64, os: ubuntu-20.04, nightly: true }
86
- - { target: mipsel-unknown-linux-gnu, os: ubuntu-20.04, nightly: true }
87
- - { target: mips64el-unknown-linux-gnuabi64, os: ubuntu-20.04, nightly: true }
81
+ - { target: i686-unknown-linux-gnu, os: ubuntu-20.04, test: true }
82
+ - { target: i686-unknown-linux-musl, os: ubuntu-20.04, test: true }
88
83
- { target: powerpc-unknown-linux-gnu, os: ubuntu-20.04 }
89
84
- { target: powerpc64-unknown-linux-gnu, os: ubuntu-20.04 }
90
85
- { target: powerpc64le-unknown-linux-gnu, os: ubuntu-20.04 }
91
86
- { target: s390x-unknown-linux-gnu, os: ubuntu-20.04 }
92
- - { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
93
- - { target: x86_64-unknown-linux-musl, os: ubuntu-20.04 }
87
+ - { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04, test: true }
88
+ - { target: x86_64-unknown-linux-musl, os: ubuntu-20.04, test: true }
94
89
95
90
env :
96
91
BUILD_CMD : cargo
@@ -99,12 +94,10 @@ jobs:
99
94
- name : checkout source code
100
95
uses : actions/checkout@v4
101
96
102
- - name : Determine tag version
97
+ - name : set version env variable
103
98
id : version
104
99
shell : bash
105
- run : |
106
- CLEAN_TAG=${GITHUB_REF_NAME#v}
107
- echo "CLEAN_TAG=$CLEAN_TAG" >> $GITHUB_OUTPUT
100
+ run : echo "VERSION=${{ needs.crate_metadata.outputs.version }}" >> $GITHUB_OUTPUT
108
101
109
102
- name : install prerequisites
110
103
shell : bash
@@ -117,9 +110,8 @@ jobs:
117
110
- name : install Rust toolchain
118
111
uses : dtolnay/rust-toolchain@stable
119
112
with :
120
- toolchain : ${{ matrix.job.nightly == 'true' && 'nightly' || 'stable' }}
113
+ toolchain : ${{ needs.crate_metadata.outputs.msrv }}
121
114
targets : ${{ matrix.job.target }}
122
- override : true
123
115
124
116
- name : install cross
125
117
if : startsWith(matrix.job.os, 'ubuntu')
@@ -163,6 +155,7 @@ jobs:
163
155
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
164
156
165
157
- name : run tests
158
+ if : matrix.job.test
166
159
shell : bash
167
160
run : $BUILD_CMD test --workspace --locked --target=${{ matrix.job.target }}
168
161
@@ -182,18 +175,18 @@ jobs:
182
175
id : package
183
176
shell : bash
184
177
run : |
185
- CLEAN_TAG ="${{ steps.version.outputs.CLEAN_TAG }}"
178
+ VERSION ="${{ steps.version.outputs.VERSION }}"
186
179
TARGET="${{ matrix.job.target }}"
187
180
PKG_SUFFIX=".tar.gz"
188
181
case "$TARGET" in
189
182
*-pc-windows-msvc) PKG_SUFFIX=".zip" ;;
190
183
esac
191
184
192
- PKG_NAME="mago-${CLEAN_TAG }-${TARGET}${PKG_SUFFIX}"
185
+ PKG_NAME="mago-${VERSION }-${TARGET}${PKG_SUFFIX}"
193
186
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_OUTPUT
194
187
195
188
PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"
196
- ARCHIVE_DIR="${PKG_STAGING}/mago-${CLEAN_TAG }-${TARGET}/"
189
+ ARCHIVE_DIR="${PKG_STAGING}/mago-${VERSION }-${TARGET}/"
197
190
mkdir -p "${ARCHIVE_DIR}"
198
191
199
192
# Binary
@@ -205,10 +198,10 @@ jobs:
205
198
pushd "${PKG_STAGING}/" >/dev/null
206
199
case "$PKG_SUFFIX" in
207
200
.zip)
208
- 7z -y a "${PKG_NAME}" "mago-${CLEAN_TAG }-${TARGET}/*"
201
+ 7z -y a "${PKG_NAME}" "mago-${VERSION }-${TARGET}/*"
209
202
;;
210
203
.tar.gz)
211
- tar czf "${PKG_NAME}" "mago-${CLEAN_TAG }-${TARGET}"/*
204
+ tar czf "${PKG_NAME}" "mago-${VERSION }-${TARGET}"/*
212
205
;;
213
206
esac
214
207
popd >/dev/null
@@ -220,9 +213,9 @@ jobs:
220
213
if : matrix.job.target == 'x86_64-unknown-linux-gnu'
221
214
shell : bash
222
215
run : |
223
- CLEAN_TAG ="${{ steps.version.outputs.CLEAN_TAG }}"
224
- # Since WASM is universal, just name it 'mago-{CLEAN_TAG }-wasm.tar.gz'
225
- WASM_PKG_NAME="mago-${CLEAN_TAG }-wasm.tar.gz"
216
+ VERSION ="${{ steps.version.outputs.VERSION }}"
217
+ # Since WASM is universal, just name it 'mago-{VERSION }-wasm.tar.gz'
218
+ WASM_PKG_NAME="mago-${VERSION }-wasm.tar.gz"
226
219
echo "WASM_PKG_NAME=${WASM_PKG_NAME}" >> $GITHUB_OUTPUT
227
220
228
221
WASM_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/wasm"
@@ -235,9 +228,9 @@ jobs:
235
228
- name : create Debian package
236
229
id : debian-package
237
230
shell : bash
238
- if : startsWith(matrix.job.os, 'ubuntu') && !endsWith(matrix.job.target, 'bsd ')
231
+ if : startsWith(matrix.job.os, 'ubuntu') && !endsWith(matrix.job.target, 'freebsd ')
239
232
run : |
240
- CLEAN_TAG ="${{ steps.version.outputs.CLEAN_TAG }}"
233
+ VERSION ="${{ steps.version.outputs.VERSION }}"
241
234
TARGET="${{ matrix.job.target }}"
242
235
243
236
# Derive arch from target:
@@ -252,7 +245,7 @@ jobs:
252
245
*s390x*) DPKG_ARCH="s390x" ;;
253
246
esac
254
247
255
- DPKG_NAME="mago-${CLEAN_TAG }-${TARGET}.deb"
248
+ DPKG_NAME="mago-${VERSION }-${TARGET}.deb"
256
249
257
250
echo "DPKG_NAME=${DPKG_NAME}" >> $GITHUB_OUTPUT
258
251
@@ -269,7 +262,7 @@ jobs:
269
262
mkdir -p "${DPKG_DIR}/DEBIAN"
270
263
cat > "${DPKG_DIR}/DEBIAN/control" <<EOF
271
264
Package: mago
272
- Version: ${CLEAN_TAG }
265
+ Version: ${VERSION }
273
266
Section: devel
274
267
Priority: optional
275
268
Maintainer: ${{ needs.crate_metadata.outputs.maintainer }}
0 commit comments