mirror of
https://github.com/Merith-TK/modpack-template.git
synced 2024-11-26 23:36:21 +00:00
update modpack template build steps for icons
This commit is contained in:
parent
7753302451
commit
c21f000c0a
9 changed files with 167 additions and 48 deletions
36
.github/workflows/build.yml
vendored
Normal file
36
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
name: Build Project
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # Change this to your preferred branch
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '16' # Change to '8' for Java 8
|
||||
|
||||
- name: Install BusyBox and 7z
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y busybox p7zip-full
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.20' # Specify the Go version you need
|
||||
|
||||
- name: Update Packwiz
|
||||
run: make update-packwiz
|
||||
|
||||
- name: Make Modpack
|
||||
run: make preClean multimc curseforge modrinth postClean
|
76
.github/workflows/release.yml
vendored
Normal file
76
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
name: Build Project
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '16' # Change to '8' for Java 8
|
||||
|
||||
- name: Install BusyBox and 7z
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y busybox p7zip-full
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 'latest' # Always use the latest Go version
|
||||
|
||||
- name: Update Packwiz
|
||||
run: make update-packwiz
|
||||
|
||||
- name: Make Modpack
|
||||
run: make preClean multimc curseforge modrinth postClean
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload MultiMC Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: .build/*-multimc.zip
|
||||
asset_name: multimc.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
- name: Upload CurseForge Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: .build/*-curseforge.zip
|
||||
asset_name: curseforge.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
- name: Upload Modrinth Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: .build/*-modrinth.mrpack
|
||||
asset_name: modrinth.mrpack
|
||||
asset_content_type: application/octet-stream
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -9,7 +9,11 @@
|
|||
.minecraft/realms_persistence.json
|
||||
|
||||
## Ignore Modpack Updater Script loose files
|
||||
.build
|
||||
.run
|
||||
.server
|
||||
.technic
|
||||
|
||||
*.zip
|
||||
*.mrpack
|
||||
|
||||
|
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
@ -1,14 +1,14 @@
|
|||
hash-format = "sha256"
|
||||
|
||||
[[files]]
|
||||
file = "icon.png"
|
||||
hash = "50f74a7debb4a852e1384434500515f2478b8dcf0d71b75eba148ca34d89715c"
|
||||
|
||||
[[files]]
|
||||
file = "icons/images.png.pw.toml"
|
||||
hash = "a779f12ed53f4af7c51b914dcc3722bb9b14508bf3b49b49408853f5ee78c52e"
|
||||
metafile = true
|
||||
|
||||
[[files]]
|
||||
file = "modpack-template_icon.png"
|
||||
hash = "50f74a7debb4a852e1384434500515f2478b8dcf0d71b75eba148ca34d89715c"
|
||||
|
||||
[[files]]
|
||||
file = "mods/lithium.pw.toml"
|
||||
hash = "b3b33c53f8356928f86223f26eaebd7a266d610f8628e5077cda196192b0b7e4"
|
||||
|
|
|
@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
|
|||
[index]
|
||||
file = "index.toml"
|
||||
hash-format = "sha256"
|
||||
hash = "3ad9c66d0812efb7f388bdbf2c913670aec193da576563d97bccc33db54b06c2"
|
||||
hash = "16610c083ce2ed510a301da5867d023e0d81cbbd2c1603e017827d7130e3234d"
|
||||
|
||||
[versions]
|
||||
fabric = "0.16.4"
|
||||
|
|
84
Makefile
84
Makefile
|
@ -2,83 +2,79 @@ default:
|
|||
@echo "No Default make command configured"
|
||||
@echo "Please use either"
|
||||
@echo " - make multimc"
|
||||
@echo " - make local multimc"
|
||||
@echo " - make curseforge"
|
||||
@echo " - make modrinth"
|
||||
@echo " - make local technic"
|
||||
@echo " - make technic"
|
||||
@echo " - make server"
|
||||
@echo " - make all"
|
||||
@echo ""
|
||||
@echo "Curseforge will make a curseforge import file"
|
||||
@echo ""
|
||||
@echo "Modrinth will make a modrinth import file"
|
||||
@echo ""
|
||||
@echo "Multimc will make a multimc zip file which contains"
|
||||
@echo " the packwiz updater"
|
||||
@echo ""
|
||||
@echo "Technic will make a technic pack zip"
|
||||
@echo ""
|
||||
@echo "Server will make a server pack zip"
|
||||
@echo " This will include the packwiz updater,"
|
||||
@echo " but will not be configured to run by default"
|
||||
@echo ""
|
||||
@echo "All will make all packs it can"
|
||||
@echo ""
|
||||
|
||||
PACKNAME := $(notdir $(CURDIR))
|
||||
PACKNAME := $(notdir $(shell pwd))
|
||||
ICONNAME := $(shell echo $(PACKNAME) | sed 's/[^a-zA-Z0-9]/_/g')
|
||||
PACKURL := $(shell pw detect)
|
||||
|
||||
curseforge: refresh
|
||||
-mkdir .build
|
||||
build: refresh
|
||||
@mkdir -p .build
|
||||
@echo "PACKNAME: ${PACKNAME}"
|
||||
@echo "ICONNAME: ${ICONNAME}"
|
||||
@echo "PACKURL: ${PACKURL}"
|
||||
|
||||
curseforge: build
|
||||
@echo "Making Curseforge pack"
|
||||
packwiz curseforge export --pack-file .minecraft/pack.toml
|
||||
mv ./*.zip ./.build/${PACKNAME}-curseforge.zip
|
||||
|
||||
modrinth: refresh
|
||||
-mkdir .build
|
||||
modrinth: build
|
||||
@echo "Making Modrinth pack"
|
||||
packwiz modrinth export --pack-file .minecraft/pack.toml
|
||||
mv ./*.mrpack ./.build/${PACKNAME}-modrinth.mrpack
|
||||
|
||||
multimc: refresh
|
||||
-mkdir .build
|
||||
multimc: build
|
||||
@echo "Making MultiMC pack"
|
||||
cp .minecraft/icon.png ./${ICONNAME}_icon.png
|
||||
7z d .build/${PACKNAME}-multimc.zip ./* -r
|
||||
7z d .build/${PACKNAME}-multimc.zip ./.minecraft -r
|
||||
@sed -i 's#{PACKURL}#${PACKURL}#' instance.cfg
|
||||
@sed -i 's#{ICONNAME}#${ICONNAME}#' instance.cfg
|
||||
7z a .build/${PACKNAME}-multimc.zip ./* -r
|
||||
7z a .build/${PACKNAME}-multimc.zip ./.minecraft -r
|
||||
7z d .build/${PACKNAME}-multimc.zip ./.build ./.minecraft/mods ./.minecraft/pack.toml ./.minecraft/index.toml -r
|
||||
rm ./${ICONNAME}_icon.png
|
||||
@sed -i 's#${PACKURL}#{PACKURL}#' instance.cfg
|
||||
@sed -i 's#${ICONNAME}#{ICONNAME}#' instance.cfg
|
||||
|
||||
|
||||
technic: refresh
|
||||
-mkdir .build
|
||||
# Technic targets
|
||||
technic: build
|
||||
@echo "Making Technic pack"
|
||||
@mkdir -p .technic
|
||||
-rm -rf .technic
|
||||
-cp -r .minecraft .technic
|
||||
cp ${PACKNAME}_icon.png .technic/icon.png
|
||||
cp -r .minecraft .technic
|
||||
cp .minecraft/icon.png .technic/icon.png
|
||||
cd .technic && java -jar ../.minecraft/packwiz-installer-bootstrap.jar ../.minecraft/pack.toml && cd ..
|
||||
-rm -rf .technic/packwiz* .technic/index.toml .technic/pack.toml .technic/mods/*.toml
|
||||
7z d .build/${PACKNAME}-technic.zip ./* ./.* -r
|
||||
7z a .build/${PACKNAME}-technic.zip ./.technic/* -r
|
||||
|
||||
server: refresh
|
||||
-mkdir .build
|
||||
# Server target
|
||||
server: build
|
||||
@echo "Making Server pack"
|
||||
-rm -rf .server
|
||||
-cp -r .minecraft .server
|
||||
cp ${PACKNAME}_icon.png .server/server-icon.png
|
||||
@mkdir -p .server
|
||||
mc-server-icon --icon .minecraft/icon.png --output .server/server-icon.png
|
||||
cd .server && java -jar ../.minecraft/packwiz-installer-bootstrap.jar -s server ../.minecraft/pack.toml && cd ..
|
||||
7z d .build/${PACKNAME}-server.zip ./* ./.* -r
|
||||
7z a .build/${PACKNAME}-server.zip ./.server/* -r
|
||||
|
||||
preClean: refresh
|
||||
-rm -rf .build
|
||||
-rm -rf .server
|
||||
postClean: refresh
|
||||
-rm -rf .technic
|
||||
-rm -rf .server
|
||||
preClean:
|
||||
-rm -rf .build .server .technic
|
||||
-rm -f ./instance.cfga*
|
||||
|
||||
postClean:
|
||||
-git gc --aggressive --prune
|
||||
|
||||
clean: preClean postClean
|
||||
|
||||
all: preClean curseforge modrinth multimc technic server postClean
|
||||
|
@ -89,12 +85,18 @@ refresh:
|
|||
update-packwiz:
|
||||
go install github.com/packwiz/packwiz@latest
|
||||
go install github.com/Merith-TK/packwiz-wrapper/cmd/pw@main
|
||||
go install github.com/Merith-TK/utils/cmd/mc-server-icon@main
|
||||
clear
|
||||
@echo "Packwiz has been Updated"
|
||||
|
||||
run-server:
|
||||
cd .minecraft && pw refresh && cd ..
|
||||
-mkdir .run
|
||||
echo "eula=true" > .run/eula.txt
|
||||
cd .run && java -jar ../.minecraft/packwiz-installer-bootstrap.jar ../.minecraft/pack.toml -s server && cd ..
|
||||
cd .run && java -Xmx2G -Xms2G -jar server.jar nogui && cd ..
|
||||
@cd .minecraft && pw refresh
|
||||
@mkdir -p .run
|
||||
@echo "eula=true" > .run/eula.txt
|
||||
@mc-server-icon --icon .minecraft/icon.png --output .run/server-icon.png
|
||||
@cd .run && java -jar ../.minecraft/packwiz-installer-bootstrap.jar ../.minecraft/pack.toml -s server
|
||||
@if [ ! -f .run/server.jar ]; then \
|
||||
echo "Downloading Fabric server jar..."; \
|
||||
curl -o .run/server.jar https://meta.fabricmc.net/v2/versions/loader/1.21.1/0.16.5/1.0.1/server/jar; \
|
||||
fi
|
||||
@cd .run && java -Xmx2G -Xms2G -jar server.jar nogui
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[General]
|
||||
InstanceType=OneSix
|
||||
iconKey=modpack.icon
|
||||
iconKey={ICONNAME}_icon
|
||||
name=Modpack Template
|
||||
OverrideCommands=true
|
||||
PreLaunchCommand="$INST_JAVA" -jar packwiz-installer-bootstrap.jar {PACKURL}
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
Loading…
Reference in a new issue