Skip to content

Commit a966e7c

Browse files
committed
build: 测试构建 v7
1 parent 4b91763 commit a966e7c

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

.github/workflows/build-and-release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ jobs:
2929
- name: Build with Gradle
3030
run: ./gradlew clean build
3131

32-
- name: Upload build artifacts
33-
uses: actions/upload-artifact@v4
34-
with:
35-
name: my-build
36-
path: '**/build/libs/*.jar'
32+
- name: Upload each jar separately
33+
run: |
34+
for file in $(find . -name "*.jar" -path "*/build/libs/*"); do
35+
echo "Uploading $file"
36+
artifact_name=$(basename "$file" .jar)
37+
gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber
38+
done
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3741

3842
release:
3943
needs: build
@@ -57,9 +61,11 @@ jobs:
5761
env:
5862
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5963

60-
- name: Upload artifact to Release
61-
uses: softprops/action-gh-release@v1
62-
with:
63-
files: ./build-artifacts/**/*.jar
64+
- name: Upload jars to Release separately
65+
run: |
66+
for file in ./build-artifacts/**/*.jar; do
67+
echo "Uploading $file"
68+
gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber
69+
done
6470
env:
6571
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)