Compare commits

..

7 Commits

Author SHA1 Message Date
Klop233
2a846bf4d4 update 2024-04-13 09:15:03 +08:00
Klop233
6397d020c4 update 2024-04-13 09:07:58 +08:00
Klop233
349f9e5d5c update 2024-04-13 08:58:28 +08:00
Klop233
ef174a74fa update 2024-04-13 08:44:29 +08:00
Klop233
14a522ea08 update 2024-04-13 08:39:24 +08:00
Klop233
3f5c5e538e update 2024-04-13 08:26:20 +08:00
Klop233
a83c72b524 绝对没问题 2024-04-13 08:24:25 +08:00

View File

@@ -5,6 +5,7 @@ sha256() {
prop() {
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
project_id="luminol"
mcversion_group=$(prop GroupMCV)
mcversion=$(prop mcVersion)
@@ -15,14 +16,18 @@ if [ $pre = "true" ]; then
else
channel="default"
fi
changes=$(git log -1 --pretty="[{'commit': '%H', 'message': '%s', 'summary': '%b'}]")
changes=$(git log -1 --pretty="[{\"commit\": \"%H\", \"message\": \"%s\", \"summary\": \"%b\"}]")
jar_sha256=`sha256 build/libs/luminol-1.20.4-paperclip.jar`
jar_name="luminol-1.20.4-paperclip.jar"
ctime=$(date -u +"%s")"000"
# v2
echo "Authentication: $secret_v2"
echo "[DEBUG] curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" -H "Content-Type: application/json" -H "Authorization: $secret_v2" -d "jar_name=$jar_name&channel=$channel&release_tag=$tag&sha256=$jar_sha256&time=$ctime&changes=\"$changes\""
"
curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" -H "Content-Type: application/json" -H "Authorization: $secret_v2" -d "jar_name=$jar_name&channel=$channel&release_tag=$tag&sha256=$jar_sha256&time=$ctime&changes=\"$changes\""
#echo "{\"version_group\":\"$mcversion_group\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"release_tag\":\"$tag\",\"time\":\"$ctime\"}" > data.json
json=$(printf "{\"channel\":\"%s\", \"jar_name\":\"%s\", \"sha256\":\"%s\", \"tag\":\"%s\", \"time\":\"%s\", \"changes\":\"%s\"}" "$channel" "$jar_name" "$jar_sha256" "$tag" "$ctime" "$changes")
echo "[DEBUG] $json"
response=$(curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" \
-H "Content-Type: application/json" \
-H "Authorization: $secret_v2" \
-d "$json")
echo "[RESPONSE] $response"