Skip to content

Commit 47d09ef

Browse files
Update rust.yml
1 parent 928d85e commit 47d09ef

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

.github/workflows/rust.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,19 @@ jobs:
126126
run: |
127127
cat <<EOF > Cross.toml
128128
[target.x86_64-unknown-linux-musl]
129+
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main"
129130
pre-build = ["apk add --no-cache alsa-lib-dev"]
130131
131132
[target.aarch64-unknown-linux-musl]
133+
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main"
132134
pre-build = ["apk add --no-cache alsa-lib-dev"]
133135
134136
[target.armv7-unknown-linux-musleabihf]
137+
image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:main"
135138
pre-build = ["apk add --no-cache alsa-lib-dev"]
136139
137140
[target.arm-unknown-linux-musleabihf]
141+
image = "ghcr.io/cross-rs/arm-unknown-linux-musleabihf:main"
138142
pre-build = ["apk add --no-cache alsa-lib-dev"]
139143
EOF
140144
@@ -155,20 +159,22 @@ jobs:
155159
- name: Compress
156160
run: |
157161
mkdir -p ./artifacts
158-
# windows is the only OS using a different convention for executable file name
159-
if [[ $OS =~ ^windows.*$ ]]; then
160-
EXEC=$NAME.exe
161-
else
162-
EXEC=$NAME
163-
fi
164162
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then
165163
TAG=$GITHUB_REF_NAME
166164
else
167165
TAG=$GITHUB_SHA
168166
fi
169-
mv ./target/$TARGET/release/$EXEC ./$EXEC
170-
tar -czf ./artifacts/$NAME-$TARGET-$TAG.tar.gz $EXEC
171-
167+
if [[ $OS =~ ^windows.*$ ]]; then
168+
EXEC=$NAME.exe
169+
mv ./target/$TARGET/release/$EXEC ./$EXEC
170+
# Use 'zip' for Windows
171+
zip ./artifacts/$NAME-$TARGET-$TAG.zip $EXEC readme.md LICENSE.txt
172+
else
173+
EXEC=$NAME
174+
mv ./target/$TARGET/release/$EXEC ./$EXEC
175+
# Use 'tar' for Linux/macOS
176+
tar -czf ./artifacts/$NAME-$TARGET-$TAG.tar.gz $EXEC readme.md LICENSE.txt
177+
fi
172178
- name: Archive artifact
173179
uses: actions/upload-artifact@v4
174180
with:
@@ -190,5 +196,6 @@ jobs:
190196
- name: Release
191197
uses: softprops/action-gh-release@v1
192198
with:
193-
files: ./artifacts/*/*.tar.gz
194-
199+
files: |
200+
./artifacts/*/*.tar.gz
201+
./artifacts/*/*.zip

0 commit comments

Comments
 (0)