Skip to content

Commit c14d774

Browse files
committed
build: 测试构建 v8
1 parent a966e7c commit c14d774

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

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

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -61,6 +72,7 @@ jobs:
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

Comments
 (0)