Coder Social home page Coder Social logo

paradigmmc / mc-modpack-kit Goto Github PK

View Code? Open in Web Editor NEW
25.0 1.0 9.0 162 KB

A template designed to streamline the release process of Minecraft modpacks.

License: Creative Commons Zero v1.0 Universal

Nix 100.00%
curseforge minecraft modrinth modrinth-modpack packwiz

mc-modpack-kit's Introduction

Logo

Streamline the Minecraft Modpack Release Process with GitHub Actions!

Use this template GitHub Actions Badge Minecraft Badge


mc-modpack-kit is a GitHub Actions workflow template designed to simplify the release process of Minecraft modpacks using a structured monorepo approach. It automates essential tasks such as versioning, modpack building, and publishing on platforms like Modrinth and CurseForge.

It also includes an nix flake for you fellow nix enjoyers! The actions also use it!

Key Features

  1. Monorepo Structure

    Embrace the power of organization with a monorepo-style architecture. Each subdirectory represents a different modpack version or loader type, streamlining your management of multiple modpack variations within a single repository.

    Example subdirectories:

    • fabric/: Fabric loader version.
    • forge/: Forge loader version.

    You can create more just by initializing packwiz in the said directory of your choosing.

  2. Automated Releases

    Experience effortless version control with Release Please, which generates changelogs and handles version releases automatically, in sync with your pull requests. Maintain clarity with Conventional Commit Messages.

    Examples:

    • feat(modpack/<mod>): <description> for adding new features, configurations or content.
    • chore(modpack/<mod>): <description> for routine maintenance tasks or cleanups.
    • update(modpack/<mod>): update <mod> for updating mods to newer versions.
    • mod(modpack/<mod>): add <mod> for introducing new mods to the modpack.
  3. Mod Updates

    Update your mods effortlessly by utilizing the update.yml workflow located in .github/workflows/update.yml. This action efficiently updates all mods across all subdirectories.

Getting Started

  1. Fork the Repository

    Start by forking this repository to your GitHub account.

  2. Set Up Secrets and Permissions

    • Navigate to "Settings" -> "Secrets" and add the following secrets:
      • MODRINTH_TOKEN, MODRINTH_ID for Modrinth authentication.
      • CURSEFORGE_TOKEN, CURSEFORGE_ID for CurseForge authentication.
    • Enable "Allow GitHub Actions to create and approve pull requests" under "Settings" -> "Actions" -> "General" -> "Workflow permissions".
  3. Initialize Your Modpack

    • Generate a pack.toml file using packwiz (installation instructions here) within a modpack folder.
    • Begin by running packwiz init, preferably within the main directory.
  4. Set a release channel

    • By default this template uses the beta (0.1.0) channel, you can switch it to release (1.0.0) when you are ready!
    • This can be done via executing .github/workflows/bump-version-release.yml!
  5. You are good to go!

    • You can now merge the release PR that release please has made, sit back and enjoy a cup of coffee! ☕ ^-^

Troubleshooting and Support

If you encounter any issues or need assistance, consult the Issues page or reach out via my GitHub profile.

License

This project is licensed under the CC0 1.0 Universal License.

Acknowledgments

  • This project makes effective use of GitHub Actions and various tools to automate the modpack release process.
  • A heartfelt ❤️ thank you to Rafii for helping with this!
  • Special thanks to the GitHub community for their contributions and support.

Contributions, feedback, and improvements are warmly welcomed! Let's propel this project forward together! 🚀

mc-modpack-kit's People

Contributors

conquerix avatar dependabot[bot] avatar jh-devv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mc-modpack-kit's Issues

bug: Set version workflow fails

Describe the bug
When running the set version workflow it fails

To Reproduce
Steps to reproduce the behavior:

  1. Go to Actions
  2. Run the Set version | Manual Workflow
  3. Fails

Additional context

Run git commit --allow-empty -m "chore: release v0.3.0" -m "Release-As: v0.3.0
  git commit --allow-empty -m "chore: release v0.3.0" -m "Release-As: v0.3.0
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/bfbe7fc6-da1d-4d30-8d27-685ff7f79927.sh: line 1: unexpected EOF while looking for matching `"'
Error: Process completed with exit code 2.`

Oops

Future of the project

Challenges in Maintaining mc-modpack-kit

As the sole maintainer of mc-modpack-kit, I've encountered significant challenges in managing this GitHub Actions "template" project. Recently, I've been struggling to allocate sufficient time for its maintenance.

Please note: While I will continue maintaining this template for the time being, it's unlikely to be a long-term solution. I prioritize addressing the issues at hand first.

The Problem with GitHub Actions Complexity

As someone on HackerNews points out:

  1. Program with github actions. Google "how can I send an email with github actions?" and then plug in some marketplace tool to do it. Your workflows grow to 500-1000 lines and start having all sorts of nonsense like conditionals and the YAML becomes disgusting and hard to understand. Github actions becomes a nightmare and you've invited vendor lock in.
  1. Configure with github actions. Always ask yourself "can I push this YAML complexity into a script?" and do it if you can. Send an email? Yes, that can go in a script. Your workflow ends up being about 50-60 lines as a result and very rarely needs to be changed once you've set up. Github actions is suddenly fine and you rarely have to do that stupid push-debug-commit loop because you can debug the script locally.

For a detailed exploration of these issues, check out this video:

YouTube video

Moving Forward with Nix

Given the challenges posed by maintaining a GitHub Actions project, I'm considering a shift towards Nix, which has gained popularity recently. This move offers several advantages, including:

  • Declarativity: Nix provides a declarative approach, which aligns well with modern software development practices. This contrasts with the procedural nature of GitHub Actions YAML files.

Benefits of Nix Integration

  • Simplified Maintenance: By leveraging Nix with GitHub Actions, we can streamline our workflows and avoid the complexities inherent in managing sprawling YAML configurations.
  • Version Pinning: Instances like issue #72, where dropping older versions caused inconvenience, can be mitigated through better version control and pinning offered by Nix.

The other actions like bumping versions could be simplified.
A robust but simple pipeline could be achieved.

And as @logamaster said on the Discord:

I say make a simple one file action.
It just reads a release from github and pushes the result.

So using the tag value, push to Modrinth and CurseForge or when a tag is pushed build and set up the result.
This could be done with nix


Considering the challenges in managing a GitHub Actions project, I'm contemplating exploring alternatives like Nix, though the extensive rework required raises concerns about time constraints at least for me, since I have other stuff to do.

feat: reworking actions structure

Splitting workflows into multiple files like

Handles releases with release please

.github/workflows/release.yml

Triggers on release, builds the project, uploads to artifacts

.github/workflows/build.yml

Final, publishes to ModRinth and CurseForge

.github/workflows/publish.yml

Unexpected HTTP response: 404 when trying to download packwiz

Describe the bug
The github action is trying to build the pack but https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip gives a 404 response

Run supplypike/setup-bin@v3
  with:
    uri: https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip
    name: packwiz
    version: linux
  env:
    pack-file: pack.toml
    default-release-modrinth: true
    default-release-curseforge: false
    loader: quilt
    game-version: 1.20.2
Error: Error: Unexpected HTTP response: 404

Additional context

Client and server packs

Is it possible to have both client and server versions of one pack at the same time and released together for a new version ?

docs: add to Modrinth Docs

Describe the solution you'd like
Add this project to the official Modrinth docs

Additional context
I recently opened [this ] (modrinth/docs#124)
This issue is done when its merged!

  • Add to Modrinth Docs

An option to disable commit links in changelog

Is your feature request related to a problem? Please describe.
Most often i merge releases as a single commit. In these cases commit links aren't really useful.

Describe the solution you'd like
I'm not sure how this would be possible, but an option or a config file to disable the links would be nice.

Additional context
Also, these changelogs can be really long.
Example from one of my packs:

### ☀ Modpack Changes

* **mods:** Add Red Bits ([3230d01](https://github.com/tazta2ra/bluelotus-beyond/commit/3230d01308afefe0dedf325abb6f40edaf0fafd8))
* **mods:** Added Enderman Overhaul ([2532337](https://github.com/tazta2ra/bluelotus-beyond/commit/2532337ef050d6ceadd0edefe12a1a7aae76258b))
* **mods:** Added Formations ([113d1b7](https://github.com/tazta2ra/bluelotus-beyond/commit/113d1b7f53f50c66ead9846139d1a48f7583b0d7))
* **mods:** Added Formations Nether ([6bc93f6](https://github.com/tazta2ra/bluelotus-beyond/commit/6bc93f6e718ec3f7e87cfa91f2fbb1fe2d04ed3e))
* **mods:** Added Formations Overworld ([6bc93f6](https://github.com/tazta2ra/bluelotus-beyond/commit/6bc93f6e718ec3f7e87cfa91f2fbb1fe2d04ed3e))
* **mods:** Added Macaw's Paintings ([2532337](https://github.com/tazta2ra/bluelotus-beyond/commit/2532337ef050d6ceadd0edefe12a1a7aae76258b))
* **mods:** Added Useful Brush ([9c4226f](https://github.com/tazta2ra/bluelotus-beyond/commit/9c4226fa650e71af3579bcf62404b36f6d0ed15c))
* **mods:** Added Villages&Pillages ([9c4226f](https://github.com/tazta2ra/bluelotus-beyond/commit/9c4226fa650e71af3579bcf62404b36f6d0ed15c))
* **mods:** Added Why Does My Glass Sound Like That ([2532337](https://github.com/tazta2ra/bluelotus-beyond/commit/2532337ef050d6ceadd0edefe12a1a7aae76258b))
* **mods:** Added Yung's Menu Tweaks ([9c4226f](https://github.com/tazta2ra/bluelotus-beyond/commit/9c4226fa650e71af3579bcf62404b36f6d0ed15c))
* **mods:** Added Chef's Delight ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Flash ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Head in the Clouds ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added More Axolotl Variants Mod ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Mythic Charms ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added NicerTabBackground ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Panorama Screens ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Potion Cauldron ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Screenshot Viewer ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Seamless Loading Screen ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Soul Fire'd ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Torch hit! ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **mods:** Added Water Resistance Potion ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))
* **resourcepacks:** Added Blue Lotus: GUI ([143a5d2](https://github.com/tazta2ra/bluelotus-beyond/commit/143a5d24aa310abc5810b500eda66ff490581c16))

bug: handle multiple loaders

Is your feature request related to a problem? Please describe.
Currently, mc-modpack-kit, does not handle multiple loaders, it just sets the $loader variable if it finds one

Describe the solution you'd like
Handle multiple loaders

Describe alternatives you've considered
Maybe just different git repos, bit complex but still

Additional context
Would be useful in wynncraft 101

  • Handle if a project has multiple loaders

error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

Describe the bug
just updated my pack and ran into that error message in the Build Modpack Step

  error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
  
         at «none»:0: (source not available)
  Error: The process '/nix/var/nix/profiles/default/bin/nix-env' failed with exit code 1

To Reproduce
Steps to reproduce the behavior:

  1. push to branch
  2. it errors in the Handle Releases step

Expected behavior
it should work

Additional context
pipeline that errored
https://github.com/Fauli1221/PonyCraftANewGenerationVanilla/actions/runs/8480132868/job/23235321967

style: Modpack specific changelogs

The default Changelogs generated by Release Please dont't really fit modpacks.

For example:

  • one of the most common changes in modpacks are mod updates, but there's no obvious way to mark these with Conventional commits. What type should I use for them? Most mod updates IMO don't require a minor version change since most mod updates are also patch releases. (Or maybe i just shouldn't write out all the updated mods :P )

It would be nice if there were options to customize how the changelog is generated, also I'm not really familiar with changelogs or Release Please, but i wanted to open this issue to start a discussion.

add mcman support

Add better mcman support

  • mcman export packwiz exports the pack metadata file inside pack folder by default, ie. pack/pack.toml
  • mcman export mrpack can be used to generate an mrpack
  • the modpack version can be found under the optional variable MODPACK_VERSION in server.toml

Packwiz doesn't generate pack.toml/creates empty index.toml

Describe the bug
A clear and concise description of what the bug is.

It creates an EMPTY index.toml
Also doesn't create a pack.toml file at ALL.

To Reproduce
Steps to reproduce the behavior:

  1. Create to repo from template and clone
  2. use direnv
  3. packwiz init
  4. No file generated after use

refactor!: move to monorepos

So!
I have been thinking of migrating the template structure to resamble a monorepo
This could help a lot when doing stuff with multiple versions of the modpack, e.g. when you have a fabric and quilt version of your pack

The other improvement this would yeild is that in general this would make mc-modpack-kit hell a lot more modular

bug: handle if a project has older versions

Is your feature request related to a problem? Please describe.
if a project has older GitHub releases, currently release-please just exits

Additional context
This would be useful in wynncraft 101

  • Handle if a project has older versions

Updating arbitrary files

Is your feature request related to a problem? Please describe.
I'm making a large modpack, I have multiple places where i include the version of the pack. (In pack.toml, On the main menu, in the Better Compatibility Checker, etc.)

Describe the solution you'd like
I think it would be nice if there was a file where we can manually include the files where we want to update the files.

Release please already has a way to do this, but I'm not sure how this would apply to mc-modpack-kit
https://github.com/googleapis/release-please/blob/main/docs/customizing.md#updating-arbitrary-files

feat: Bug report Issue Template

Is your feature request related to a problem? Please describe.
A bug report option to the issue templates. Just wanted to report a bug but then saw that there was no bug option.

Describe the solution you'd like
A bug report template for easy bug reporting

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.