Skip to content

Commit 6d66167

Browse files
authored
Merge pull request #5 from 3944Realms/rebuild-develop
Rebuild develop
2 parents 1bbdf99 + c14d774 commit 6d66167

File tree

5 files changed

+386
-18
lines changed

5 files changed

+386
-18
lines changed

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

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ name: Build and Release
22

33
on:
44
push:
5+
branches:
6+
- "rebuild-develop" # develop分支
7+
- "rebuild-release" # release 分支
58
tags:
6-
- 'build*' # 当推送以 build:开头的 tag 时触发,比如 buildXXXX
9+
- 'build-*' #tag 时跑 build + release
710
workflow_dispatch: # 允许手动触发
811

912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
1215

1316
steps:
14-
- name: Checkout repository #在 GitHub Actions 的虚拟机上,把仓库里的代码拉下来
17+
- name: Checkout repository
1518
uses: actions/checkout@v3
1619

1720
- name: Set up JDK 17
@@ -26,23 +29,39 @@ jobs:
2629
- name: Build with Gradle
2730
run: ./gradlew clean build
2831

29-
- name: Upload build artifacts
30-
uses: actions/upload-artifact@v3
32+
- name: Upload common jar
33+
uses: actions/upload-artifact@v4
3134
with:
32-
name: my-build
33-
path: '**/build/libs/*.jar'
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
3443

3544
release:
36-
needs: build # 这个 job 依赖于上一个 job build 完成。
45+
needs: build
3746
runs-on: ubuntu-latest
47+
if: startsWith(github.ref, 'refs/tags/build-') # 只有打 tag 才执行 release
3848
steps:
39-
- name: Download build artifact # 把上一个 job 上传的构建产物下载到当前 job 的 runner 上。
40-
uses: actions/download-artifact@v3
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
58+
uses: actions/download-artifact@v4
4159
with:
42-
name: my-build
43-
path: ./build-artifacts
60+
name: CommonApi
61+
path: ./build-artifacts/CommonApi
4462

45-
- name: Create GitHub Release # 在 GitHub 上创建一个新的 Release(版本发布)
63+
# 创建 Release
64+
- name: Create GitHub Release
4665
id: create_release
4766
uses: softprops/action-gh-release@v1
4867
with:
@@ -53,9 +72,12 @@ jobs:
5372
env:
5473
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5574

56-
- name: Upload artifact to Release # 上传构建产物到 Release
57-
uses: softprops/action-gh-release@v1
58-
with:
59-
files: ./build-artifacts/**/*.jar
75+
# 上传各子项目 JAR 到 Release
76+
- name: Upload jars to Release separately
77+
run: |
78+
for file in ./build-artifacts/**/*.jar; do
79+
echo "Uploading $file"
80+
gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber
81+
done
6082
env:
6183
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

gradle/wrapper/gradle-wrapper.jar

-16.8 KB
Binary file not shown.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Sun Sep 22 17:25:46 CST 2024
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
4-
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.12-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 251 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)