From a966e7c2f56da3cf27c90a84b18c7f6959b4206e Mon Sep 17 00:00:00 2001 From: 3944Realms Date: Sun, 21 Sep 2025 15:39:59 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=B5=8B=E8=AF=95=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=20v7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-and-release.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 94c6798..093830d 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -29,11 +29,15 @@ jobs: - name: Build with Gradle run: ./gradlew clean build - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: my-build - path: '**/build/libs/*.jar' + - name: Upload each jar separately + run: | + for file in $(find . -name "*.jar" -path "*/build/libs/*"); do + echo "Uploading $file" + artifact_name=$(basename "$file" .jar) + gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release: needs: build @@ -57,9 +61,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload artifact to Release - uses: softprops/action-gh-release@v1 - with: - files: ./build-artifacts/**/*.jar + - name: Upload jars to Release separately + run: | + for file in ./build-artifacts/**/*.jar; do + echo "Uploading $file" + gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber + done env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}