From 232014007316dd0b10aaa8bd185db2b44f88e19b Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 28 Dec 2024 18:49:58 +0100 Subject: [PATCH 1/4] Build for other versions Now supports all 1.21s --- .forgejo/workflows/build.yml | 35 +++++++++++++++++++++-------------- pom.xml | 4 +++- tools/download_nms.sh | 19 +++++++++++++++++++ 3 files changed, 43 insertions(+), 15 deletions(-) create mode 100755 tools/download_nms.sh diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index f467172..6e1abd9 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -1,25 +1,32 @@ on: [push] jobs: - deploy: + build: runs-on: docker container: debian:sid steps: - - name: Prepare for installation - run: apt update - name: Install JDK and other deps - run: apt install --no-install-recommends -y openjdk-21-jdk-headless maven git nodejs curl zstd - - #- name: BuildTools for NMS - # run: mkdir /tmp/buildtools && cd /tmp/buildtools && curl -O https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && java -jar BuildTools.jar --rev 1.21.1 --remapped && cd - - - name: Download NMS - run: curl -O https://git.m724.eu/Minecon724/temporary/raw/branch/master/XRIH.tar.zst && tar -xaf XRIH.tar.zst -C ~ && rm XRIH.tar.zst + run: apt update && apt install --no-install-recommends -y openjdk-21-jdk-headless maven git nodejs curl zstd - name: Clone repository - run: git clone https://git.m724.eu/Minecon724/tweaks724.git . - - name: Build - run: mvn clean package + run: git clone -b ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} https://git.m724.eu/Minecon724/tweaks724.git . + + - name: Download NMS + run: ./tools/download_nms.sh ~ + + + + - name: Build for 1.21.1 + run: mkdir artifact && mvn clean package && mv target/tweaks-*+1.21.1.jar artifact/ + + - name: Build for 1.21.3 + run: find src \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/v1_21_R1/v1_21_R2/g" && mvn clean package -Dproject.minecraft.version=1.21.3 && mv target/tweaks-*+1.21.3.jar artifact/ + + - name: Build for 1.21.4 + run: find src \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/v1_21_R2/v1_21_R3/g" && mvn clean package -Dproject.minecraft.version=1.21.4 && mv target/tweaks-*+1.21.4.jar artifact/ + + + - name: Upload artifacts uses: https://github.com/actions/upload-artifact@v3 with: - path: target \ No newline at end of file + path: artifact \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2758b38..408b8cf 100644 --- a/pom.xml +++ b/pom.xml @@ -16,10 +16,12 @@ 21 21 UTF-8 - 1.21.1-R0.1-SNAPSHOT + 1.21.1 + ${project.minecraft.version}-R0.1-SNAPSHOT + ${artifactId}-${version}+${project.minecraft.version} src/main/resources diff --git a/tools/download_nms.sh b/tools/download_nms.sh new file mode 100755 index 0000000..c22aac4 --- /dev/null +++ b/tools/download_nms.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# +# Copyright (C) 2024 Minecon724 +# Tweaks724 is licensed under the GNU General Public License. See the LICENSE.md file +# in the project root for the full license text. +# + +FILENAME=MS4yMS4xLTQK.tar.zst + +curl -O https://36ab09b1.m724.eu/$FILENAME +if [ "$(sha512sum $FILENAME)" = "475b931b6dde126aafd3f959bd02e122aa3c671ad11e83cbe1a9c9ea771a424f203381aa31e4ab40052dae1bfbe96c61daa81add1afab46dd423a5f038d68a6b MS4yMS4xLTQK.tar.zst" ]; then + tar -xaf $FILENAME -C "$1" + rm $FILENAME +else + echo "Checksum invalid" + rm $FILENAME + exit 1 +fi From c0a94eb7dabd5dc05f866e3adb67d1c9b86e173e Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 28 Dec 2024 18:51:42 +0100 Subject: [PATCH 2/4] Fix warnings that are because I copied the line --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 408b8cf..887a0a6 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ - ${artifactId}-${version}+${project.minecraft.version} + ${project.artifactId}-${project.version}+${project.minecraft.version} src/main/resources From 6eb8769998ab1dbf3bec4c422b0ac7f9c7faa888 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 28 Dec 2024 18:52:00 +0100 Subject: [PATCH 3/4] [maven-release-plugin] prepare release tweaks-0.1.9 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 887a0a6..72d9e5c 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ eu.m724 tweaks - 0.1.9-SNAPSHOT + 0.1.9 21 @@ -175,6 +175,6 @@ scm:git:git@git.m724.eu:Minecon724/tweaks724.git - HEAD + tweaks-0.1.9 \ No newline at end of file From d70d65569f3ddac9444835a378913a847b2e09e7 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 28 Dec 2024 18:52:02 +0100 Subject: [PATCH 4/4] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 72d9e5c..a965a93 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ eu.m724 tweaks - 0.1.9 + 0.1.10-SNAPSHOT 21 @@ -175,6 +175,6 @@ scm:git:git@git.m724.eu:Minecon724/tweaks724.git - tweaks-0.1.9 + HEAD \ No newline at end of file