From d55d1fac3bc3309e9ef4f300c9cda03babf506de Mon Sep 17 00:00:00 2001 From: Xikaro Date: Mon, 5 Jan 2026 17:29:39 +0500 Subject: [PATCH] feat: docker --- .github/workflows/build.yml | 48 ++++++++++++++++------ .gitignore | 17 +++++--- .pakku/docker-overrides/docker-compose.yml | 30 ++++++++++++++ .pakku/server-overrides/server.properties | 2 +- 4 files changed, 77 insertions(+), 20 deletions(-) create mode 100644 .pakku/docker-overrides/docker-compose.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e719ced3..7e3648d1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -327,19 +327,23 @@ jobs: sed -i -e "s/DEV/${VERSION}/g" pakku.json + sed -i -e "s/DEV/${VERSION}/g" .github/docker/docker-compose.yml sed -i -e "s/DEV/${VERSION}/g" config/mod-director/modpack.json sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/gui_main_menu.txt - sed -i -e "s/DEV/${VERSION}/g" .pakku/multimc-overrides/instance.cfg - sed -i -e "s/LOADER_VERSION/${LOADER_VERSION}/g" .pakku/multimc-overrides/mmc-pack.json - sed -i -e "s/LOADER_TYPE/${LOADER_TYPE}/g" .pakku/multimc-overrides/mmc-pack.json - sed -i -e "s/MINECRAFT_VERSION/${MINECRAFT_VERSION}/g" .pakku/multimc-overrides/mmc-pack.json + sed -i -e "s/DEV/${VERSION}/g" .pakku/server-overrides/server.properties + + sed -i -e "s/LOADER_VERSION/${LOADER_VERSION}/g" .pakku/multimc-overrides/mmc-pack.json sed -i -e "s/LOADER_VERSION/${LOADER_VERSION}/g" .pakku/server-overrides/forge-auto-install.txt + + sed -i -e "s/LOADER_TYPE/${LOADER_TYPE}/g" .pakku/multimc-overrides/mmc-pack.json sed -i -e "s/LOADER_TYPE/${LOADER_TYPE}/g" .pakku/server-overrides/forge-auto-install.txt + + sed -i -e "s/MINECRAFT_VERSION/${MINECRAFT_VERSION}/g" .pakku/multimc-overrides/mmc-pack.json sed -i -e "s/MINECRAFT_VERSION/${MINECRAFT_VERSION}/g" .pakku/server-overrides/forge-auto-install.txt - - name: 📝 Cache pakku + - name: 📝 Cache Pakku uses: actions/cache@v5.0.1 id: cache with: @@ -347,7 +351,7 @@ jobs: key: pakku-cache-${{ hashFiles('pakku-lock.json') }} restore-keys: pakku-cache- - - name: 📦 Export modpack + - name: 📦 Export Modpack run: | # curl https://github.com/juraj-hrivnak/pakku/releases/latest/download/pakku.jar -o pakku.jar -L -J java -jar pakku.jar fetch @@ -356,7 +360,7 @@ jobs: mkdir -p .pakku/multimc-overrides/flame mkdir -p .pakku/multimc-overrides/mods - - name: 📁 Preparing the artifact curseforge + - name: 📁 Preparing the artifact CurseForge run: | cd ./build/curseforge/ mv *.zip $(basename -s .zip *.zip)-curseforge.zip @@ -368,19 +372,19 @@ jobs: path: ./build/curseforge/${{ needs.info.outputs.project_full_name }}-curseforge.zip if-no-files-found: error - - name: 📁 Preparing the artifact modrinth + - name: 📁 Preparing the artifact Modrinth run: | cd ./build/modrinth/ mv *.mrpack $(basename -s .mrpack *.mrpack)-modrinth.mrpack - - name: 🚀 Upload artifact modrinth + - name: 🚀 Upload artifact Modrinth uses: actions/upload-artifact@v6.0.0 with: name: ${{ needs.info.outputs.project_full_name }}-modrinth path: ./build/modrinth/${{ needs.info.outputs.project_full_name }}-modrinth.mrpack if-no-files-found: warn - - name: 📁 Preparing the artifact multimc + - name: 📁 Preparing the artifact MultiMC run: | mkdir -p .pakku/multimc-overrides/flame mkdir -p .pakku/multimc-overrides/mods @@ -397,25 +401,39 @@ jobs: cd ./build/multimc/ zip -r ${{ needs.info.outputs.project_full_name }}-multimc.zip icon.png mmc-pack.json instance.cfg .minecraft/ flame/ - - name: 🚀 Upload artifact multimc + - name: 🚀 Upload artifact MultiMC uses: actions/upload-artifact@v6.0.0 with: name: ${{ needs.info.outputs.project_full_name }}-multimc path: ./build/multimc/${{ needs.info.outputs.project_full_name }}-multimc.zip if-no-files-found: error - - name: 📁 Preparing the artifact server + - name: 📁 Preparing the artifact Server run: | cd ./build/serverpack/ mv *.zip $(basename -s .zip *.zip)-serverpack.zip - - name: 🚀 Upload artifact server + - name: 🚀 Upload artifact Server uses: actions/upload-artifact@v6.0.0 with: name: ${{ needs.info.outputs.project_full_name }}-serverpack path: ./build/serverpack/${{ needs.info.outputs.project_full_name }}-serverpack.zip if-no-files-found: error + - name: 📁 Preparing the artifact Docker + run: | + mv -vf .pakku/docker-overrides ./build/docker + + cd ./build/docker/ + mv *.yml $(basename -s .yml *.yml)-docker.yml + + - name: 🚀 Upload Docker Artifact + uses: actions/upload-artifact@v6.0.0 + with: + name: ${{ needs.info.outputs.project_full_name }}-docker + path: ./.github/docker/${{ needs.info.outputs.project_full_name }}-docker.yml + if-no-files-found: error + release-github: name: 🚀 Release to GitHub needs: [info, build-project] @@ -449,6 +467,9 @@ jobs: if [ ! -f ${{ needs.info.outputs.project_full_name }}-multimc.zip ]; then echo '::error::No value found for artifact `multimc.zip`.' && exit 1 fi + if [ ! -f ${{ needs.info.outputs.project_full_name }}-docker.yml ]; then + echo '::error::No value found for artifact `docker.yml`.' && exit 1 + fi echo "✔️ All artifacts found" - name: 📄 Format diff @@ -476,6 +497,7 @@ jobs: ${{ needs.info.outputs.project_full_name }}-modrinth.mrpack ${{ needs.info.outputs.project_full_name }}-serverpack.zip ${{ needs.info.outputs.project_full_name }}-multimc.zip + ${{ needs.info.outputs.project_full_name }}-docker.yml prerelease: ${{ needs.info.outputs.release_type != 'release' }} generate_release_notes: true token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 36bbc1365..6237e42b1 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,10 @@ build/ !.pakku/**/* !pakku.jar +# Docker +/.github/docker/data +/.github/docker/backups + # Configs config/jei/world/ config/gregtech/terminal/ @@ -62,9 +66,11 @@ defaultconfigs/ftbranks/players.snbt !bansoukou/**.zip -/.bobby/ -/.mixin.out/ +/.bobby +/.mixin.out /tacz/tacz_default_gun +/tacz_backup +/moonlight-global-datapacks /classOut /backups /profileImage @@ -93,6 +99,9 @@ defaultconfigs/ftbranks/players.snbt /gtceu/prospection_cache /data /ESM +/schematics +/scripts +/gtceu # Client data bansoukou @@ -128,7 +137,3 @@ libEffekseerNativeForJava.so # .pakku/server-overrides/scripts # .pakku/server-overrides/mods # .pakku/server-overrides/user_jvm_args.txt - - - - diff --git a/.pakku/docker-overrides/docker-compose.yml b/.pakku/docker-overrides/docker-compose.yml new file mode 100644 index 000000000..23e50b657 --- /dev/null +++ b/.pakku/docker-overrides/docker-compose.yml @@ -0,0 +1,30 @@ +services: + minecraft: + image: itzg/minecraft-server:latest + container_name: terrafirmagreg-modern + tty: true + stdin_open: true + ports: + - "25565:25565" + environment: + EULA: "true" + ENABLE_RCON: "false" + GUI: "false" + MEMORY: 8G + + TYPE: CUSTOM + CUSTOM_SERVER: ./minecraft_server.jar + SKIP_GENERIC_PACK_UPDATE_CHECK: "true" + OVERRIDE_SERVER_PROPERTIES: "false" + + + GENERIC_PACKS: TerraFirmaGreg-Modern-DEV-serverpack + GENERIC_PACKS_SUFFIX: .zip + GENERIC_PACKS_PREFIX: https://github.com/TerraFirmaGreg-Team/Modpack-Modern/releases/download/DEV/ + + volumes: + - ./data:/data + - ./backups:/backups + +volumes: + minecraft-data: diff --git a/.pakku/server-overrides/server.properties b/.pakku/server-overrides/server.properties index 918e3e5f0..ee7804237 100644 --- a/.pakku/server-overrides/server.properties +++ b/.pakku/server-overrides/server.properties @@ -29,7 +29,7 @@ max-chained-neighbor-updates=1000000 max-players=64 max-tick-time=600000 max-world-size=29999984 -motd=[TerraFirmaGreg-Modern] +motd=[TerraFirmaGreg-Modern] Server DEV network-compression-threshold=256 online-mode=true op-permission-level=4