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