Update rust.yml (#8)

fix artifacts upload.
This commit is contained in:
Sijie.Sun 2024-01-31 10:53:11 +08:00 committed by GitHub
parent f92ff73a3c
commit a0e59f5c56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,25 +60,28 @@ jobs:
run: cargo build --release --verbose --target $TARGET
- name: Compress
run: |
mkdir -p ./artifacts
mkdir -p ./artifacts/objects/
# windows is the only OS using a different convention for executable file name
if [[ $OS =~ ^windows.*$ ]]; then
SUFFIX=.exe
cp third_party/Packet.dll ./artifacts/objects/
cp third_party/wintun.dll ./artifacts/objects/
fi
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then
TAG=$GITHUB_REF_NAME
else
TAG=$GITHUB_SHA
fi
mv ./target/$TARGET/release/easytier-core"$SUFFIX" ./artifacts/
mv ./target/$TARGET/release/easytier-cli"$SUFFIX" ./artifacts/
tar -cvf ./artifacts/$NAME-$TARGET-$TAG.tar -C ./artifacts easytier-core"$SUFFIX" easytier-cli"$SUFFIX"
mv ./target/$TARGET/release/easytier-core"$SUFFIX" ./artifacts/objects/
mv ./target/$TARGET/release/easytier-cli"$SUFFIX" ./artifacts/objects/
tar -cvf ./artifacts/$NAME-$TARGET-$TAG.tar ./artifacts/objects/*
rm -rf ./artifacts/objects/
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: easytier-${{ matrix.OS }}-${{ matrix.TARGET }}
path: |
./artifacts/$NAME-$TARGET-$TAG.tar
./artifacts/*
test:
runs-on: ubuntu-latest
steps: