@@ -29,27 +29,38 @@ jobs:
2929 - name : Build with Gradle
3030 run : ./gradlew clean build
3131
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 }}
32+ - name : Upload common jar
33+ uses : actions/upload-artifact@v4
34+ with :
35+ name : Common
36+ path : Common/build/libs/*.jar
37+
38+ - name : Upload common api jar
39+ uses : actions/upload-artifact@v4
40+ with :
41+ name : CommonApi
42+ path : CommonApi/build/libs/*.jar
4143
4244 release :
4345 needs : build
4446 runs-on : ubuntu-latest
4547 if : startsWith(github.ref, 'refs/tags/build-') # 只有打 tag 才执行 release
4648 steps :
47- - name : Download build artifact
49+ # 下载 Common JAR
50+ - name : Download Common artifact
51+ uses : actions/download-artifact@v4
52+ with :
53+ name : Common
54+ path : ./build-artifacts/Common
55+
56+ # 下载 CommonApi JAR
57+ - name : Download CommonApi artifact
4858 uses : actions/download-artifact@v4
4959 with :
50- name : my-build
51- path : ./build-artifacts
60+ name : CommonApi
61+ path : ./build-artifacts/CommonApi
5262
63+ # 创建 Release
5364 - name : Create GitHub Release
5465 id : create_release
5566 uses : softprops/action-gh-release@v1
6172 env :
6273 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6374
75+ # 上传各子项目 JAR 到 Release
6476 - name : Upload jars to Release separately
6577 run : |
6678 for file in ./build-artifacts/**/*.jar; do
0 commit comments