From c0634a335ed8d0ebe79f90b03b2e7d12bbd0ac67 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 14:48:42 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20GitHub=20Actions=20=E4=B8=8A=E4=BC=A0ZIP?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 49 +++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ac888f..79e8a3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,19 +36,36 @@ jobs: draft: false prerelease: false - - name: Upload all *.zip artifacts from submodules - run: | - for module in novel-common novel-crawl novel-front novel-admin - do - for file in $(find ./$module/target/build -type f -name "*.zip") - do - asset_path="$file" - asset_name=$(basename "$file") - echo "Uploading $asset_name..." - curl -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: application/zip" \ - --data-binary @"$file" \ - "${{ steps.create_release.outputs.upload_url }}?name=$asset_name" - done - done \ No newline at end of file + + # 使用 action 来替代直接 curl 进行上传 + - name: Upload sql.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-common/target/build/sql.zip + asset_name: sql.zip + asset_content_type: application/zip + + - name: Upload novel-crawl.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-crawl/target/build/novel-crawl.zip + asset_name: novel-crawl.zip + asset_content_type: application/zip + + - name: Upload novel-front.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-front/target/build/novel-front.zip + asset_name: novel-front.zip + asset_content_type: application/zip + + - name: Upload novel-admin.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-admin/target/build/novel-admin.zip + asset_name: novel-admin.zip + asset_content_type: application/zip \ No newline at end of file