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