mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Init 1.21.5 setup
This commit is contained in:
38
.github/workflows/auto-update.yml
vendored
38
.github/workflows/auto-update.yml
vendored
@@ -1,9 +1,9 @@
|
|||||||
name: Automatically update Gale commit hash
|
name: Automatically update Paper commit hash
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 1 * * *"
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -15,32 +15,32 @@ jobs:
|
|||||||
path: 'Leaf'
|
path: 'Leaf'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Checkout Gale repository
|
- name: Checkout Paper repository
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
with:
|
with:
|
||||||
path: 'Gale'
|
path: 'Paper'
|
||||||
repository: "Dreeam-qwq/Gale"
|
repository: "PaperMC/Paper"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Get Gale latest commit Hash
|
- name: Get Paper latest commit Hash
|
||||||
id: galeCommit
|
id: paperCommit
|
||||||
run: |
|
run: |
|
||||||
cd Gale
|
cd Paper
|
||||||
echo "galeCommit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
echo "paperCommit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Get Leaf Current Gale commit Hash
|
- name: Get Leaf Current Paper commit Hash
|
||||||
id: currGaleRef
|
id: currPaperCommit
|
||||||
run: |
|
run: |
|
||||||
cd Leaf
|
cd Leaf
|
||||||
currGaleRef=$(grep "^galeCommit\s*=" gradle.properties | sed 's/^galeCommit\s*=\s*//')
|
currPaperCommit=$(grep "^paperCommit\s*=" gradle.properties | sed 's/^paperCommit\s*=\s*//')
|
||||||
echo "currGaleRef=$currGaleRef" >> $GITHUB_OUTPUT
|
echo "currPaperCommit=$currPaperCommit" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Update galeCommit in Leaf
|
- name: Update paperCommit in Leaf
|
||||||
run: |
|
run: |
|
||||||
cd Leaf
|
cd Leaf
|
||||||
sed -i "s/\(galeCommit\s*=\s*\).*/\1$PAPER_REF/" gradle.properties
|
sed -i "s/\(paperCommit\s*=\s*\).*/\1$PAPER_COMMIT/" gradle.properties
|
||||||
env:
|
env:
|
||||||
PAPER_REF: ${{ steps.galeCommit.outputs.galeCommit }}
|
PAPER_COMMIT: ${{ steps.paperCommit.outputs.paperCommit }}
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
run: |
|
run: |
|
||||||
@@ -61,7 +61,7 @@ jobs:
|
|||||||
echo "Running tests...."
|
echo "Running tests...."
|
||||||
./gradlew applyAllPatches
|
./gradlew applyAllPatches
|
||||||
./gradlew build -x test
|
./gradlew build -x test
|
||||||
./gradlew rebuildGalePatches
|
./gradlew rebuildPaperPatches
|
||||||
./gradlew rebuildAllServerPatches
|
./gradlew rebuildAllServerPatches
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -72,10 +72,10 @@ jobs:
|
|||||||
echo "Writing to repo....."
|
echo "Writing to repo....."
|
||||||
git add .
|
git add .
|
||||||
chmod +x ./scripts/upstreamCommit.sh
|
chmod +x ./scripts/upstreamCommit.sh
|
||||||
./scripts/upstreamCommit.sh --gale $CURR_GALE_REF
|
./scripts/upstreamCommit.sh --paper $CURR_PAPER_COMMIT
|
||||||
git push
|
git push
|
||||||
else
|
else
|
||||||
echo "No changes to commit."
|
echo "No changes to commit."
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
CURR_GALE_REF: ${{ steps.currGaleRef.outputs.currGaleRef }}
|
CURR_PAPER_COMMIT: ${{ steps.currPaperCommit.outputs.currPaperCommit }}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
name: Build Leaf 1.21.4
|
name: Build Leaf 1.21.5
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "ver/1.21.4" ]
|
branches: [ "ver/1.21.5" ] # no build until update finished
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -95,13 +95,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Rename Paperclip JARs
|
- name: Rename Paperclip JARs
|
||||||
run: |
|
run: |
|
||||||
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.4-${{ env.BUILD_NUMBER }}-mojmap.jar
|
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.5-${{ env.BUILD_NUMBER }}.jar
|
||||||
|
|
||||||
- name: Upload Leaf as build artifact
|
- name: Upload Leaf as build artifact
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: Leaf 1.21.4
|
name: Leaf 1.21.5
|
||||||
path: ./leaf-1.21.4-*.jar
|
path: ./leaf-1.21.5-*.jar
|
||||||
|
|
||||||
- name: Prepare release notes and artifacts
|
- name: Prepare release notes and artifacts
|
||||||
run: |
|
run: |
|
||||||
@@ -122,11 +122,11 @@ jobs:
|
|||||||
- name: Release Leaf
|
- name: Release Leaf
|
||||||
uses: softprops/action-gh-release@master
|
uses: softprops/action-gh-release@master
|
||||||
with:
|
with:
|
||||||
name: "Leaf 1.21.4"
|
name: "Leaf 1.21.5"
|
||||||
tag_name: "ver-1.21.4"
|
tag_name: "ver-1.21.5"
|
||||||
files: "./leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar"
|
files: "./leaf-1.21.5-${{ env.BUILD_NUMBER }}.jar"
|
||||||
body_path: "./release_notes.md"
|
body_path: "./release_notes.md"
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
target_commitish: "${{ github.sha }}"
|
target_commitish: "${{ github.sha }}"
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: true
|
||||||
8
.github/workflows/build-pr.yml
vendored
8
.github/workflows/build-pr.yml
vendored
@@ -2,7 +2,7 @@ name: Build Pull Request
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "ver/1.21.4" ]
|
branches: [ "ver/1.21.5" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -35,9 +35,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Rename Paperclip JARs
|
- name: Rename Paperclip JARs
|
||||||
run: |
|
run: |
|
||||||
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.4-mojmap.jar
|
mv leaf-server/build/libs/leaf-paperclip-1.21.5-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.5.jar
|
||||||
- name: Upload Leaf as build artifact
|
- name: Upload Leaf as build artifact
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: Leaf 1.21.4
|
name: Leaf 1.21.5
|
||||||
path: ./leaf-1.21.4-*.jar
|
path: ./leaf-1.21.5.jar
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,7 +25,5 @@ run
|
|||||||
leaf-api/build.gradle.kts
|
leaf-api/build.gradle.kts
|
||||||
leaf-server/build.gradle.kts
|
leaf-server/build.gradle.kts
|
||||||
leaf-server/src/minecraft
|
leaf-server/src/minecraft
|
||||||
gale-api
|
|
||||||
gale-server
|
|
||||||
paper-api
|
paper-api
|
||||||
paper-server
|
paper-server
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[](https://github.com/Winds-Studio/Leaf/releases)⠀
|
[](https://github.com/Winds-Studio/Leaf/releases)⠀
|
||||||
[](https://github.com/Winds-Studio/Leaf/actions)⠀
|
[](https://github.com/Winds-Studio/Leaf/actions)⠀
|
||||||
[](https://discord.gg/gfgAwdSEuM)
|
[](https://discord.gg/gfgAwdSEuM)
|
||||||
[](https://docs.leafmc.one)
|
[](https://docs.leafmc.one)
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ Building a Paperclip JAR for distribution:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.dreeam.leaf</groupId>
|
<groupId>cn.dreeam.leaf</groupId>
|
||||||
<artifactId>leaf-api</artifactId>
|
<artifactId>leaf-api</artifactId>
|
||||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
<version>1.21.5-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
@@ -77,7 +77,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("cn.dreeam.leaf:leaf-api:1.21.4-R0.1-SNAPSHOT")
|
compileOnly("cn.dreeam.leaf:leaf-api:1.21.5-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("io.papermc.paperweight.patcher") version "2.0.0-beta.14"
|
id("io.papermc.paperweight.patcher") version "2.0.0-beta.16"
|
||||||
}
|
}
|
||||||
|
|
||||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||||
@@ -64,30 +64,25 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
paperweight {
|
paperweight {
|
||||||
upstreams.register("gale") {
|
upstreams.register("paper") {
|
||||||
repo = github("Dreeam-qwq", "Gale")
|
repo = github("Dreeam-qwq", "Paper")
|
||||||
ref = providers.gradleProperty("galeCommit")
|
ref = providers.gradleProperty("paperCommit")
|
||||||
|
|
||||||
patchFile {
|
patchFile {
|
||||||
path = "gale-server/build.gradle.kts"
|
path = "paper-server/build.gradle.kts"
|
||||||
outputFile = file("leaf-server/build.gradle.kts")
|
outputFile = file("leaf-server/build.gradle.kts")
|
||||||
patchFile = file("leaf-server/build.gradle.kts.patch")
|
patchFile = file("leaf-server/build.gradle.kts.patch")
|
||||||
}
|
}
|
||||||
patchFile {
|
patchFile {
|
||||||
path = "gale-api/build.gradle.kts"
|
path = "paper-api/build.gradle.kts"
|
||||||
outputFile = file("leaf-api/build.gradle.kts")
|
outputFile = file("leaf-api/build.gradle.kts")
|
||||||
patchFile = file("leaf-api/build.gradle.kts.patch")
|
patchFile = file("leaf-api/build.gradle.kts.patch")
|
||||||
}
|
}
|
||||||
patchRepo("paperApi") {
|
patchDir("paperApi") {
|
||||||
upstreamPath = "paper-api"
|
upstreamPath = "paper-api"
|
||||||
|
excludes = setOf("build.gradle.kts")
|
||||||
patchesDir = file("leaf-api/paper-patches")
|
patchesDir = file("leaf-api/paper-patches")
|
||||||
outputDir = file("paper-api")
|
outputDir = file("paper-api")
|
||||||
}
|
}
|
||||||
patchDir("galeApi") {
|
|
||||||
upstreamPath = "gale-api"
|
|
||||||
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
|
|
||||||
patchesDir = file("leaf-api/gale-patches")
|
|
||||||
outputDir = file("gale-api")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
group=cn.dreeam.leaf
|
group=cn.dreeam.leaf
|
||||||
mcVersion=1.21.4
|
mcVersion=1.21.5
|
||||||
version=1.21.4-R0.1-SNAPSHOT
|
version=1.21.5-R0.1-SNAPSHOT
|
||||||
|
|
||||||
galeCommit=804ecea02f411f02758d76745742f66112e7b3ed
|
paperCommit=bf0a1298ec5172d9ea46a4ff4670a615aae013c7
|
||||||
|
|
||||||
org.gradle.configuration-cache=true
|
org.gradle.configuration-cache=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ IS_UNSUPPORTED=false
|
|||||||
|
|
||||||
RELEASE_NOTES="release_notes.md"
|
RELEASE_NOTES="release_notes.md"
|
||||||
|
|
||||||
# Rename Leaf jar
|
|
||||||
mv ./leaf-1.21.4-"${BUILD_NUMBER}"-mojmap.jar ./leaf-1.21.4-"${BUILD_NUMBER}".jar
|
|
||||||
|
|
||||||
# Branch name
|
# Branch name
|
||||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
echo "✨Current branch: $CURRENT_BRANCH"
|
echo "✨Current branch: $CURRENT_BRANCH"
|
||||||
@@ -47,7 +44,7 @@ echo "" >> $RELEASE_NOTES
|
|||||||
} >> $RELEASE_NOTES
|
} >> $RELEASE_NOTES
|
||||||
|
|
||||||
# Get checksums
|
# Get checksums
|
||||||
file="./leaf-1.21.4-"${BUILD_NUMBER}".jar"
|
file="./leaf-1.21.5-"${BUILD_NUMBER}".jar"
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
MD5=$(md5sum "$file" | awk '{ print $1 }')
|
MD5=$(md5sum "$file" | awk '{ print $1 }')
|
||||||
SHA256=$(sha256sum "$file" | awk '{ print $1 }')
|
SHA256=$(sha256sum "$file" | awk '{ print $1 }')
|
||||||
@@ -88,5 +85,5 @@ if [ "$IS_UNSUPPORTED" = true ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete last tag
|
# Delete last tag
|
||||||
gh release delete ver-1.21.4 --cleanup-tag -y -R "${GITHUB_REPO}"
|
gh release delete ver-1.21.5 --cleanup-tag -y -R "${GITHUB_REPO}"
|
||||||
echo "🚀Ready for release"
|
echo "🚀Ready for release"
|
||||||
|
|||||||
@@ -4,9 +4,8 @@
|
|||||||
# Credit: https://github.com/PurpurMC/Purpur
|
# Credit: https://github.com/PurpurMC/Purpur
|
||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
# upstreamCommit --paper HASH --gale HASH --purpur HASH --leaves HASH
|
# upstreamCommit --paper HASH --purpur HASH --leaves HASH
|
||||||
# flag: --paper HASH - (Optional) the commit hash to use for comparing commits between paper (PaperMC/Paper/compare/HASH...HEAD)
|
# flag: --paper HASH - (Optional) the commit hash to use for comparing commits between paper (PaperMC/Paper/compare/HASH...HEAD)
|
||||||
# flag: --gale HASH - the commit hash to use for comparing commits between gale (Dreeam-qwq/Gale/compare/HASH...HEAD)
|
|
||||||
# flag: --purpur HASH - the commit hash to use for comparing commits between purpur (PurpurMC/Purpur/compare/HASH...HEAD)
|
# flag: --purpur HASH - the commit hash to use for comparing commits between purpur (PurpurMC/Purpur/compare/HASH...HEAD)
|
||||||
# flag: --leaves HASH - the commit hash to use for comparing commits between leaves (LeavesMC/Leaves/compare/HASH...HEAD)
|
# flag: --leaves HASH - the commit hash to use for comparing commits between leaves (LeavesMC/Leaves/compare/HASH...HEAD)
|
||||||
|
|
||||||
@@ -18,13 +17,12 @@ function getCommits() {
|
|||||||
set -e
|
set -e
|
||||||
PS1="$"
|
PS1="$"
|
||||||
|
|
||||||
galeHash=$(git diff gradle.properties | awk '/^-galeCommit =/{print $NF}')
|
paperHash=$(git diff gradle.properties | awk '/^-paperCommit =/{print $NF}')
|
||||||
paperHash=""
|
|
||||||
purpurHash=""
|
purpurHash=""
|
||||||
leavesHash=""
|
leavesHash=""
|
||||||
|
|
||||||
# Useless params standardize
|
# Useless params standardize
|
||||||
# TEMP=$(getopt --long paper:,gale:,purpur:,leaves: -o "" -- "$@")
|
# TEMP=$(getopt --long paper:,purpur:,leaves: -o "" -- "$@")
|
||||||
# eval set -- "$TEMP"
|
# eval set -- "$TEMP"
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -32,10 +30,6 @@ while true; do
|
|||||||
paperHash="$2"
|
paperHash="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--gale)
|
|
||||||
galeHash="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
--purpur)
|
--purpur)
|
||||||
purpurHash="$2"
|
purpurHash="$2"
|
||||||
shift 2
|
shift 2
|
||||||
@@ -51,7 +45,6 @@ while true; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
paper=""
|
paper=""
|
||||||
gale=""
|
|
||||||
purpur=""
|
purpur=""
|
||||||
leaves=""
|
leaves=""
|
||||||
updated=""
|
updated=""
|
||||||
@@ -59,7 +52,8 @@ logsuffix=""
|
|||||||
|
|
||||||
# Paper updates
|
# Paper updates
|
||||||
if [ -n "$paperHash" ]; then
|
if [ -n "$paperHash" ]; then
|
||||||
paper=$(getCommits "PaperMC/Paper" "$paperHash" "HEAD")
|
newHash=$(git diff gradle.properties | awk '/^+paperCommit =/{print $NF}')
|
||||||
|
paper=$(getCommits "PaperMC/Paper" "$paperHash" $(echo $newHash | grep . -q && echo $newHash || echo "HEAD"))
|
||||||
|
|
||||||
# Updates found
|
# Updates found
|
||||||
if [ -n "$paper" ]; then
|
if [ -n "$paper" ]; then
|
||||||
@@ -68,18 +62,6 @@ if [ -n "$paperHash" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Gale updates
|
|
||||||
if [ -n "$galeHash" ]; then
|
|
||||||
newHash=$(git diff gradle.properties | awk '/^+galeCommit =/{print $NF}')
|
|
||||||
gale=$(getCommits "Dreeam-qwq/Gale" "$galeHash" $(echo $newHash | grep . -q && echo $newHash || echo "HEAD"))
|
|
||||||
|
|
||||||
# Updates found
|
|
||||||
if [ -n "$gale" ]; then
|
|
||||||
updated="${updated:+$updated/}Gale"
|
|
||||||
logsuffix="$logsuffix\n\nGale Changes:\n$gale"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Purpur updates
|
# Purpur updates
|
||||||
if [ -n "$purpurHash" ]; then
|
if [ -n "$purpurHash" ]; then
|
||||||
purpur=$(getCommits "PurpurMC/Purpur" "$purpurHash" "HEAD")
|
purpur=$(getCommits "PurpurMC/Purpur" "$purpurHash" "HEAD")
|
||||||
|
|||||||
@@ -11,6 +11,28 @@ plugins {
|
|||||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
|
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!file(".git").exists()) {
|
||||||
|
// Gale start - build changes
|
||||||
|
val errorText = """
|
||||||
|
|
||||||
|
=====================[ ERROR ]=====================
|
||||||
|
The Leaf project directory is not a properly cloned Git repository.
|
||||||
|
|
||||||
|
In order to build Leaf from source you must clone
|
||||||
|
the Leaf repository using Git, not download a code
|
||||||
|
zip from GitHub.
|
||||||
|
|
||||||
|
Built Leaf jars are available for download at
|
||||||
|
https://www.leafmc.one/download
|
||||||
|
|
||||||
|
See https://github.com/PaperMC/Paper/blob/main/CONTRIBUTING.md
|
||||||
|
for further information on building and modifying Paper forks.
|
||||||
|
===================================================
|
||||||
|
""".trimIndent()
|
||||||
|
// Gale end - build changes
|
||||||
|
error(errorText)
|
||||||
|
}
|
||||||
|
|
||||||
rootProject.name = "leaf"
|
rootProject.name = "leaf"
|
||||||
|
|
||||||
for (name in listOf("leaf-api", "leaf-server")) {
|
for (name in listOf("leaf-api", "leaf-server")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user