9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-20 15:29:33 +00:00

Modify upstream script

This commit is contained in:
Samsuik
2025-06-26 19:59:58 +01:00
parent 991f961f38
commit 647605ea0e

View File

@@ -3,10 +3,10 @@ exit_on_error() {
exit 1 exit 1
} }
git reset HEAD --hard #git reset HEAD --hard
oldHash=$(grep "paperRef=" gradle.properties | cut -d "=" -f2) oldHash=$(grep "paperRef=" gradle.properties | cut -d "=" -f2)
newHash=$(curl -s https://api.github.com/repos/PaperMC/paper/commits/master | jq -r .sha) newHash=$(curl -s https://api.github.com/repos/PaperMC/paper/commits/$1 | jq -r .sha)
if [ "$oldHash" = "$newHash" ]; then if [ "$oldHash" = "$newHash" ]; then
echo "Upstream has not updated!" echo "Upstream has not updated!"
@@ -18,9 +18,13 @@ echo "Updating paper: $oldHash -> $newHash"
sed -i "s/$oldHash/$newHash/g" gradle.properties sed -i "s/$oldHash/$newHash/g" gradle.properties
git add gradle.properties git add gradle.properties
./gradlew applyPatches || exit_on_error "An error occurred when merging patches!" ./gradlew cleanCache
./gradlew rebuildPatches || exit_on_error "An error occurred when rebuilding patches!" ./gradlew applyPaperSingleFilePatchesFuzzy || exit_on_error "An error occurred when applying single file patches!"
./gradlew createReobfPaperclipJar || exit_on_error "An error occurred when building!" ./gradlew rebuildPaperSingleFilePatches || exit_on_error "An error occurred when rebuilding single file patches!"
./gradlew applyAllPatches || exit_on_error "An error occurred when merging patches!"
./gradlew rebuildPaperApiPatches || exit_on_error "An error occurred when rebuilding api patches!"
./gradlew rebuildAllServerPatches || exit_on_error "An error occurred when rebuilding server patches!"
./gradlew createMojmapPaperclipJar || exit_on_error "An error occurred when building!"
scripts/upstreamCommit.sh $oldHash $newHash scripts/upstreamCommit.sh $oldHash $newHash