Update CI

This commit is contained in:
ShintoKosei
2024-04-06 20:29:43 +08:00
committed by GitHub
parent 7522e3c67b
commit a9238f8e8e
3 changed files with 12 additions and 10 deletions

View File

@@ -44,7 +44,7 @@ jobs:
tag: ${{ env.tag }}
name: Luminol ${{ env.version }} - ${{ env.commitid }}
body: |
📦Version: `${{ env.version }}` | Commit ${{ env.commitid }} [![download](https://img.shields.io/github/downloads/LuminolMC/Luminol/${{ env.tag }}/total?color=0&style=flat-square)](https://github.com/LeavesMC/LuminolMC/Luminol/download/${{ env.tag }}/luminol-1.20.4-paperclip.jar)
📦Version: `${{ env.version }}` | Commit ${{ env.commitid }} [![download](https://img.shields.io/github/downloads/LuminolMC/Luminol/${{ env.tag }}/total?color=0)](https://github.com/LeavesMC/LuminolMC/Luminol/download/${{ env.tag }}/luminol-1.20.4-paperclip.jar)
This release is automatically compiled by GitHub Actions
artifacts: |
build/libs/luminol-1.20.4-bundler.jar

View File

@@ -7,5 +7,7 @@ org.gradle.caching = true
org.gradle.parallel = true
org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx3G
mcVersion_Group=1.20
mcVersion=1.20.4
preVersion=false

View File

@@ -7,21 +7,21 @@ prop() {
}
echo "$tag"
project_id="luminol"
project_name="luminol"
mcversion_group=$(prop mcVersion_Group)
mcversion=$(prop mcVersion)
ctime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "$mcversion_group - $mcversion"
pre=$(prop preVersion)
if [ $pre = "true" ]; then
channel="experimental"
else
channel="default"
fi
promoted=false
number=$(git log --oneline ver/1.20.4 ^`git describe --tags --abbrev=0` | wc -l)
number=$(git log --oneline "ver/1.20.4" ^$(git describe --tags --abbrev=0) | wc -l)
changes=$(git log --pretty='%H<<<%s>>>' -"$number" | sed ':a;N;$!ba;s/\n//g')
jar_name="build/libs/luminol-1.20.4-paperclip.jar"
jar_sha256=`sha256 $jar_name`
jar_sha256=`sha256 build/libs/luminol-1.20.4-paperclip.jar`
echo "$har_sha256"
jar_name="luminol-1.20.4-paperclip.jar"
ctime=$(date -u +"%s")"000"
echo "$ctime"
# v2
curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" --header "Content-Type: application/json" --header "Authentication: $secret_v2" --data-raw "{\"project_id\":\"$project_id\",\"version\":\"$mcversion\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"tag\":\"$tag\"}"
curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" --header "Content-Type: application/json" --header "Authentication: $secret_v2" --data-raw "{\"version_group\":\"$mcversion_group\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"release_tag\":\"$tag\",\"time\":\"$ctime\"}"