From c968ee1a610c92bcc435e495174adf5aab3d22d2 Mon Sep 17 00:00:00 2001 From: WindowsSov8forUs Date: Fri, 19 Apr 2024 16:54:09 +0800 Subject: [PATCH] fix: workflow --- .github/workflows/release.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d989c14..d7bf415 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,11 +51,15 @@ jobs: UPLOAD_URL=$(if [ "${{ env.RELEASE_ID }}" == "null" ]; then echo "${{ steps.create_release.outputs.upload_url }}"; else echo "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets"; fi) for file in dist/*; do if [[ -f "$file" ]]; then - echo "Uploading $file" - curl \ - --header "Authorization: token ${{ secrets.PAT }}" \ - --header "Content-Type: $(file -b --mime-type $file)" \ - --data-binary @"$file" \ - "$UPLOAD_URL?name=$(basename $file)" + filename=$(basename -- "$file") + extension="${filename##*.}" + if [[ "$extension" == "exe" || "$extension" == "tar.gz" ]]; then + echo "Uploading $file" + curl \ + --header "Authorization: token ${{ secrets.PAT }}" \ + --header "Content-Type: $(file -b --mime-type $file)" \ + --data-binary @"$file" \ + "$UPLOAD_URL?name=$(basename $file)" + fi fi done \ No newline at end of file