Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Klop233 committed Apr 14, 2024
1 parent 012c138 commit 4ef8b79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_1_20_4_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
environment: default

steps:
- name: Checkout Git Repository
Expand Down
15 changes: 9 additions & 6 deletions scripts/PushToAPI.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
sha256() {
sha256sum $1 | awk '{print $1}'
}

prop() {
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
project_id="lightingluminol"

mcversion_group=$(prop GroupMCV)
mcversion=$(prop mcVersion)
pre=$(prop preVersion)
pro_id_mcv=$project_id-$mcversion

if [ $pre = "true" ]; then
channel="experimental"
else
channel="default"
fi
changes=$(git log -1 --pretty='[{"commit": "%H", "message": "%s", "summary": "%b"}]')
jar_sha256=`sha256 build/libs/lightingluminol-1.20.4-paperclip.jar`
jar_name="lightingluminol-1.20.4-paperclip.jar"

changes=$(git log -1 --pretty="[{\"commit\": \"%H\", \"message\": \"%s\", \"summary\": \"%s\"}]")
jar_sha256=`sha256 build/libs/$pro_id_mcv-paperclip.jar`
jar_name="$pro_id_mcv-paperclip.jar"
ctime=$(date -u +"%s")"000"

# 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 "{\"version_group\":\"$mcversion_group\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"release_tag\":\"$tag\",\"time\":\"$ctime\"}"
curl -L --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: $secret_v2" --data-urlencode "channel=$channel" --data-urlencode "jar_name=$jar_name" --data-urlencode "sha256=$jar_sha256" --data-urlencode "release_tag=$tag" --data-urlencode "time=$ctime" --data-urlencode "changes=$changes"

0 comments on commit 4ef8b79

Please sign in to comment.