Compare commits

...

4 Commits

Author SHA1 Message Date
Klop233
9951540a4a update CI 2024-04-03 20:56:39 +08:00
Klop233
8cdd79c1ac Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-04-03 20:53:06 +08:00
Klop233
d92fb15713 update CI 2024-04-03 20:52:36 +08:00
Klop233
971b0abca6 Update build_1_20_4.yml 2024-04-03 20:49:37 +08:00
4 changed files with 50 additions and 5 deletions

View File

@@ -61,3 +61,10 @@ jobs:
file: "build/libs/luminol-1.20.4-paperclip.jar"
file_glob: true
prerelease: true
- name: Push to API
continue-on-error: true
if: "!contains(github.event.commits[0].message, '[release-skip]')"
env:
secret_v2: ${{ secrets.API_V2_PUSH_TOKEN }}
tag: ${{ env.tag }}
run: sh scripts/PushToAPI.sh

View File

@@ -52,11 +52,6 @@ dependencies {
QQ群`368632360` | QQ频道[点击加入](https://pd.qq.com/s/eq9krf9j) | Telegram[点击加入](https://t.me/LuminolMC)
> [!WARNING]
> **此项目与Leaves无关。不要向Leaves报告任何有关协议支持的错误因为协议支持已经重构**
## 关于 Issue
当您遇到任何问题时,请向我们提问,我们将尽力解决,但请记得清楚地描述您的问题并提供足够的日志等信息。
## 贡献代码
可[查看 Contributing](./docs/CONTRIBUTING.md)
@@ -74,3 +69,7 @@ QQ群`368632360` | QQ频道[点击加入](https://pd.qq.com/s/eq9krf9j)
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
</picture>
</a>
> [!WARNING]
> **此项目与Leaves无关。不要向Leaves报告任何有关协议支持的错误因为协议支持已经重构**
>

View File

@@ -7,3 +7,10 @@ org.gradle.caching = true
org.gradle.parallel = true
org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx3G
# adapt Leaves API Push
mcVersion=1.20.4
packageVersion=1_20_R3
preVersion=false
updatingMinecraft=false

View File

@@ -0,0 +1,32 @@
sha256() {
sha256sum $1 | awk '{print $1}'
}
prop() {
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
echo "$tag"
project_id="luminol"
project_name="luminol"
mcversion=$(prop mcVersion)
ctime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
pre=$(prop preVersion)
if [ $pre = "true" ]; then
channel="experimental"
else
channel="default"
fi
promoted=false
# shellcheck disable=SC2046
number=$(git log --oneline master ^`git describe --tags --abbrev=0` | wc -l)
changes=$(git log --pretty='%H<<<%s>>>' -"$number" | sed ':a;N;$!ba;s/\n//g')
jar_name="leaves-$mcversion.jar"
jar_sha256=`sha256 $jar_name`
# v1
#curl --location --request POST "https://api.leavesmc.org/new_release" --header "Content-Type: application/json" --data-raw "{\"project_id\":\"$project_id\",\"project_name\":\"$project_name\",\"version\":\"$mcversion\",\"time\":\"$ctime\",\"channel\":\"$channel\",\"promoted\":$promoted,\"changes\":\"$changes\",\"downloads\":{\"application\":{\"name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"url\":\"https://github.com/LeavesMC/Leaves/releases/download/$tag/$jar_name\"}},\"secret\":\"$secret\"}"
#curl --location --request POST "https://api.leavesmc.org/upload_file" -F "file=@$jar_name" -F "filename=$jar_name" -F "filehash=$jar_sha256" -F "secret=$secret"
# v2
curl --location --request POST "https://api.luminolmc.com/v2/commit/build" --header "Content-Type: application/json" --header "Authentication: Bearer $secret_v2" --data-raw "{\"project_id\":\"$project_id\",\"version\":\"$mcversion\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"tag\":\"$tag\"}"