refactor for new hosting

This commit is contained in:
2025-12-20 08:12:10 -08:00
parent 57fe5d5070
commit a61701b439
12 changed files with 1589 additions and 207 deletions
+14
View File
@@ -0,0 +1,14 @@
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: npm ci
- run: npx wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
-190
View File
@@ -1,190 +0,0 @@
name: Packwiz Automated Release
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRITH_TOKEN }}
jobs:
release-notes:
name: Publish release notes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export pack variables
working-directory: ./packwiz
run: for var in $(grep = pack.toml | tr -d ' "'); do echo $var; done >> $GITHUB_ENV
- name: Generate Release Notes
id: create-release-notes
uses: johnyherangi/create-release-notes@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
format: "- {{subject}}"
- name: Create Release
continue-on-error: true
id: release
uses: comnoco/create-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: ${{ env.version }}
body: ${{ steps.create-release-notes.outputs.release-notes }}
outputs:
update: ${{ steps.release.outcome == 'success' }}
publish-pages:
if: ${{ needs.release-notes.outputs.update == 'true' }}
name: Publish update to Github Pages
needs: release-notes
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Packwiz
working-directory: ./packwiz
run: curl -L https://github.com/sugoidogo/packwiz/releases/latest/download/packwiz_linux_amd64.tar.gz | tar -xzvf - packwiz
- name: Refresh Hashes
working-directory: ./packwiz
run: ./packwiz refresh
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release-modrinth:
if: ${{ needs.release-notes.outputs.update == 'true' }}
name: Publish Modrinth pack
needs: release-notes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export pack variables
working-directory: ./packwiz
run: for var in $(grep = pack.toml | tr -d ' "'); do echo $var; done >> $GITHUB_ENV
- name: Download Packwiz
working-directory: ./packwiz
run: curl -L https://github.com/sugoidogo/packwiz/releases/latest/download/packwiz_linux_amd64.tar.gz | tar -xzvf - packwiz
- name: Build Modrinth Pack
working-directory: ./packwiz
run: |
./packwiz modrinth export
mv ${{ env.name }}*.mrpack ../${{ env.name }}.mrpack
- name: Publish Modrinth pack
uses: svenstaro/upload-release-action@v2
with:
file: ${{ env.name }}.mrpack
overwrite: true
tag: ${{ env.version }}
- name: Export loader type
if: ${{ env.MODRINTH_TOKEN && env.MODRINTH_ID }}
run: |
if [[ ! -z "${{ env.forge }} "]]; then echo "LOADER=forge" >> $GITHUB_ENV
if [[ ! -z "${{ env.fabric }} "]]; then echo "LOADER=fabric" >> $GITHUB_ENV
if [[ ! -z "${{ env.neoforge }} "]]; then echo "LOADER=neoforge" >> $GITHUB_ENV
if [[ ! -z "${{ env.quilt }} "]]; then echo "LOADER=quilt" >> $GITHUB_ENV
- name: Publish to Modrinth
if: ${{ env.MODRINTH_TOKEN && env.MODRINTH_ID }}
uses: cloudnode-pro/modrinth-publish@v2
with:
project: ${{ env.MODRINTH_ID }}
loaders: ${{ env.LOADER }}
token: ${{ env.MODRINTH_TOKEN }}
version: ${{ env.version }}
files: ${{ env.name }}.mrpack
release-curseforge:
if: ${{ needs.release-notes.outputs.update == 'true' }}
name: Publish Curseforge pack
needs: release-notes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export pack variables
working-directory: ./packwiz
run: for var in $(grep = pack.toml | tr -d ' "'); do echo $var; done >> $GITHUB_ENV
- name: Download Packwiz
working-directory: ./packwiz
run: curl -L https://github.com/sugoidogo/packwiz/releases/latest/download/packwiz_linux_amd64.tar.gz | tar -xzvf - packwiz
- name: Convert Curseforge Files
continue-on-error: true
working-directory: ./packwiz
run: ./packwiz curseforge detect
- name: Build Curseforge Pack
working-directory: ./packwiz
run: |
mkdir -p mods
./packwiz curseforge export
mv ${{ env.name }}*.zip ../${{ env.name }}-curseforge.zip
- name: Publush Curseforge pack
uses: svenstaro/upload-release-action@v2
with:
file: ${{ env.name }}-curseforge.zip
overwrite: true
tag: ${{ env.version }}
- name: Publish to Curseforge
if: ${{ env.CURSEFORGE_TOKEN && env.CURSEFORGE_ID }}
uses: itsmeow/curseforge-upload@v3
with:
project_id: ${{ env.CURSEFORGE_ID }}
token: ${{ env.CURSEFORGE_TOKEN }}
game_endpoint: 'minecraft'
file_path: ${{ env.name }}-curseforge.zip
release-prism:
if: ${{ needs.release-notes.outputs.update == 'true' }}
name: Publish Prism pack
needs: release-notes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export pack variables
working-directory: ./packwiz
run: for var in $(grep = pack.toml | tr -d ' "'); do echo $var; done >> $GITHUB_ENV
- name: Download Packwiz
working-directory: ./packwiz
run: curl -L https://github.com/sugoidogo/packwiz/releases/latest/download/packwiz_linux_amd64.tar.gz | tar -xzvf - packwiz
- name: Build Prism pack
run: |
cd packwiz
./packwiz serve &
cd ..
mkdir -p prism/minecraft
cd prism/minecraft
wget https://github.com/packwiz/packwiz-installer-bootstrap/releases/latest/download/packwiz-installer-bootstrap.jar
java -jar packwiz-installer-bootstrap.jar -g http://localhost:8080/pack.toml
cd ..
zip -r ../${{ env.name }}-prism.zip *
- name: Release Prism pack
uses: svenstaro/upload-release-action@v2
with:
file: ${{ env.name }}-prism.zip
overwrite: true
tag: ${{ env.version }}
+9 -6
View File
@@ -1,11 +1,14 @@
# including these files would overwrite user changes every update
# use a defaults mod instead
/packwiz/config.txt
/packwiz/servers.dat
assets/minecraft/config.txt
assets/minecraft/servers.dat
# it may be convienient to put the packwiz program here,
# but it is not part of the pack
/packwiz/packwiz.exe
/packwiz/packwiz
assets/packwiz.exe
assets/packwiz
# exclude packwiz exports
/packwiz/*.zip
/packwiz/*.mrpack
assets/*.zip
assets/*.mrpack
# exclude wrangler/ci files
node_modules
.wrangler
+9 -8
View File
@@ -1,17 +1,18 @@
# Packwiz Modpack with Github Actions
This repo is a template for creating a [packwiz](https://packwiz.infra.link/) modpack with an auto-updating [prism launcher](https://prismlauncher.org/) modpack using Github Actions to push updates to Github Pages and Releases.
# Packwiz Modpack with Gitea Actions / Cloudflare Pages
This repo is a template for creating a [packwiz](https://packwiz.infra.link/) modpack with an auto-updating [prism launcher](https://prismlauncher.org/) modpack using Gitea Actions to push updates to Cloudflare Pages and Gitea Releases.
It can also publish updates to Curseforge and/or Modrinth, provided a token and project ID.
## Usage
0. Clone/Fork/Download this template onto your pc
1. Enter the packwiz folder and edit the `pack.toml` or run `packwiz init -r`
2. Enter the `prism` folder and edit the `instance.cfg`, specifically the `name` and `PreLaunchCommand` variables
3. Create a new instance in Prism Launcher with your desired Minecraft and modloader versions, and copy the `mmc-pack.json` file from that instance into the `prism` folder
1. Enter the assets folder and edit the `pack.toml` or run `packwiz init -r`
2. Edit the `instance.cfg`, specifically the `name` and `PreLaunchCommand` variables
3. Create a new instance in Prism Launcher with your desired Minecraft and modloader versions, and copy the `mmc-pack.json` file from that instance into the `assets` folder
4. Replace or remove `modpack.png` and update or remove the `iconKey` in `instance.cfg` accordingly
5. Replace this `README.md` and the `LICENSE.md` files as appropriate for your modpack
6. Use `packwiz` to add mods to your pack in the `packwiz` folder
7. Test modrith export: `packwiz modrinth export`. If it fails with notification about manual downloads, you'll need to add those mods from Modrinth instead of Curseforge. If they are not availible on Modrith, do not add the jar files to the mods folder or add them via direct download url instead, as this would violate the licence terms of those mods.
8. Commit and push to GitHub.
9. (optional) In your repo settings on GitHub, under the Pages environment, add the `MODRINTH_TOKEN` and `MODRINTH_ID` and/or `CURSEFORGE_TOKEN` and `CURSEFORGE_ID` to enable automated releases on the respective site.
8. Commit and push to Gitea.
9. (optional) In your repo settings on Gitea, add the `MODRINTH_TOKEN` and `MODRINTH_ID` and/or `CURSEFORGE_TOKEN` and `CURSEFORGE_ID` action runner secrets to enable automated releases on the respective site.
Release notes are automatically generated from your commit messages. To kick off a new release, push a new git tag.
Releases and release notes are automatically generated from your `pack.toml` and commit messages. To create a new release, simply increment the `version` value in `pack.toml`, commit, and push.
Note that the prism pack requires a system installation of java version 21 or higher for the packwiz updater.
+1 -1
View File
@@ -18,6 +18,6 @@ OverrideNativeWorkarounds=false
OverridePerformance=false
OverrideWindow=false
PostExitCommand=
PreLaunchCommand=java -jar packwiz-installer-bootstrap.jar https://USERNAME.github.io/PACKNAME/packwiz/pack.toml
PreLaunchCommand=java -jar packwiz-installer-bootstrap.jar https://your.host.name/pack.toml
UseAccountForInstance=false
WrapperCommand=

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 277 B

+4 -2
View File
@@ -4,10 +4,12 @@ version = "0.0.0"
pack-format = "packwiz:1.1.0"
[index]
file = "index.toml"
file = "minecraft/index.toml"
hash-format = "sha256"
hash = "7b81c9e9d9e6e21a9865a2dded0dfd77e7683d679b98fe5b0114eaed9a31f17e"
[versions]
forge = "47.4.0"
minecraft = "1.20.1"
[options]
no-internal-hashes = true
+1535
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
{
"devDependencies": {
"wrangler": "^4.56.0"
}
}
+12
View File
@@ -0,0 +1,12 @@
{
"$schema": "./node_modules/wrangler/config-schema.json",
"name": "modpack-name",
"assets": {"directory": "assets"},
"workers_dev": false,
"keep_vars": true,
"build": {
"watch_dir": "./assets",
"cwd": "./assets",
"command": "packwiz refresh --build",
}
}