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 }}