diff --git a/.gitea/workflows/create_release.yml b/.gitea/workflows/create_release.yml new file mode 100644 index 0000000..4663d27 --- /dev/null +++ b/.gitea/workflows/create_release.yml @@ -0,0 +1,96 @@ +name: Build and Release modpack + + +on: + push: + tags: + - '**' + + +permissions: + contents: read + packages: write + + +jobs: + release: + name: Create Release from tag + runs-on: k3s + + container: + volumes: + - server:/out/server + - client:/out/client + - curse:/out/curse + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Checkout Actions and Workflows + uses: actions/checkout@v4 + with: + repository: operations/gitea-actions + token: ${{ secrets.BOT_TOKEN }} + fetch-depth: 0 + path: .gitea/actions + ref: master + + - name: Create configuration references + id: config + uses: ./.gitea/actions/job-configuration + with: + service_name: atm10 + project: minecraft + oci_registry: gitea.marquis.site + + - name: Run build tool + uses: docker://gitea.marquis.site/operations/modpack_buildah/modpack_buildah + env: + MODPACK__VERSION: "${{ github.ref_name }}" + CURSEFORGE_APIKEY: "${{ secrets.CURSEFORGE_APIKEY }}" + + - name: Build and Push Container image for the Server + run: | + docker login ${IMAGE_URL} --username gitAutomationBot --password ${{ secrets.BOT_TOKEN }} + docker build -t ${IMAGE_URL}:${{ github.ref_name }} --network host /out/server + docker tag ${IMAGE_URL}:${{ github.ref_name }} ${IMAGE_URL}:latest + docker push ${IMAGE_URL}:${{ github.ref_name }} + docker push ${IMAGE_URL}:latest + env: + IMAGE_URL: ${{ steps.config.outputs.image_path }}/${{ steps.config.outputs.image_name }} + + - name: "Push new client version to repository" + run: | + git fetch origin +refs/heads/main + git checkout main + rm -rf ./minecraft/mods + cp -r /out/client/* . + + git config user.name gitAutomationBot + git config user.email service+git@marquis.site + git add . -- :!.gitea/* + git commit -m "Version ${{ github.ref_name }}" + git push origin main + + - name: "Create Gitea Release for Curse Modpack" + uses: akkuman/gitea-release-action@v1 + with: + name: "Version ${{ github.ref_name }} (${{ steps.config.outputs.image_version }})" + body: > + Modpack Server container image: `${{ steps.config.outputs.image_path }}/${{ steps.config.outputs.image_name }}:${{ github.ref_name }}` + files: |- + /out/curse/*-${{ github.ref_name }}.zip + + - name: "Send notification" + uses: ivanmilov/telegram_notify_action@v1 + with: + api_key: ${{ secrets.TELEGRAM_API_KEY }} + chat_id: ${{ vars.TELEGRAM_CHAT_ID }} + message: > + Modpack **ATM 10** just got updated to version **${{ github.ref_name }}**! + + Go to ${{ var.SERVER_PUBLIC_URL }}/${{ github.repository }} to get instructions on how to update or + [download the newest Modpack zip directly](${{ var.SERVER_PUBLIC_URL }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}). diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..8affddb --- /dev/null +++ b/config.yml @@ -0,0 +1,26 @@ +minecraft_version: 1.21.1 +mod_loader_type: "NeoForge" + +modpack: + curse_id: 925200 # ATM10 + +customizations: + server: + extra_files: + - "./server.properties.erb" + ignored: + - "user_jvm_args.txt" + - "*.sh" + - "*.bat" + client: + extra_files: + - "./servers.dat" + mods: + - mod_id: 261725 + name: "ItemZoom" + server: false + +# Fix stupid Curse API + - mod_id: 391382 + name: "More Overlays Updated" + download_url: "https://mediafilez.forgecdn.net/files/6981/252/moreoverlays-1.24.2-mc1.21.1-neoforge.jar" diff --git a/server.properties.erb b/server.properties.erb new file mode 100644 index 0000000..448839d --- /dev/null +++ b/server.properties.erb @@ -0,0 +1,57 @@ +#Minecraft server properties +#Thu May 25 07:50:29 UTC 2023 +allow-flight=true +allow-nether=true +broadcast-console-to-ops=true +broadcast-rcon-to-ops=true +difficulty=normal +enable-command-block=false +enable-jmx-monitoring=false +enable-query=false +enable-rcon=false +enable-status=true +enforce-secure-profile=true +enforce-whitelist=true +entity-broadcast-range-percentage=100 +force-gamemode=false +function-permission-level=2 +gamemode=survival +generate-structures=true +generator-settings={} +hardcore=false +hide-online-players=false +level-name=world +level-seed= +level-type=minecraft\:normal +max-chained-neighbor-updates=1000000 +max-players=20 +max-tick-time=60000 +max-world-size=29999984 +motd=\u00A76\u00A7o<%= name %> Server\n\u00A77[\u00A73blue_smoothie & xy795\u00A77]\u00A7r - \u00A74v<%= version %> +network-compression-threshold=256 +online-mode=true +op-permission-level=4 +player-idle-timeout=0 +prevent-proxy-connections=false +previews-chat=false +pvp=true +query.port=25565 +rate-limit=0 +rcon.password= +rcon.port=25575 +require-resource-pack=false +resource-pack= +resource-pack-prompt= +resource-pack-sha1= +server-ip= +server-port=25565 +simulation-distance=10 +spawn-animals=true +spawn-monsters=true +spawn-npcs=true +spawn-protection=16 +sync-chunk-writes=true +text-filtering-config= +use-native-transport=true +view-distance=10 +white-list=true diff --git a/servers.dat b/servers.dat new file mode 100644 index 0000000..05845ad Binary files /dev/null and b/servers.dat differ