Packr is a Python CLI tool and a GitHub Workflow action used to make Minecraft Resource Packs out of multiple different directories and publish them to different distribution platforms.
Intended to be used by Resource Pack creators who are tired of uploading their content to every platform manually, it simplifies the process to just creating a new GitHub release, and everything else getting updated.
The supported distribution platforms are:
Packr generates resource packs using a YAML file.
The default file used by Packr is packr.yml
.
packr.yml
files:
- pack.zip:
- test_pack/*
- extra.zip
minecraft-versions:
- 1.18.2
The files
key is used to assign a list of files to generate.
You can automatically compress files into a .zip
file by adding more keys to a value.
To add a file too the zip file, simply give its path. (
assets/pack.mcmeta
)
To add every file from a directory to the zip file, give its path and add a star. (
assets/*
)
To use Packr as a CLI tool, you first have to install it using pip install git+https://github.com/sindercube/packr
To generate the resource packs, simply run python -m packr
Run
python -m packr -h
for additional information.
To automatically generate Resource Packs from the contents of your GitHub repository, you first have to make a new workflow YAML file in the .github/workflows/
directory.
An example of a Packr configuration, which just adds the generated files to your GitHub release.
publish.yml
on:
release:
types: [published]
jobs:
check-bats-version:
runs-on: ubuntu-latest
steps:
- name: Build & Upload Packs
uses: Sindercube/Packr@v2
with:
github-repo: ${{ github.event.repository.full_name }}
release-version: ${{ github.event.release.tag_name }}
github-token: ${{ secrets.GITHUB_TOKEN }}
A full showcase of what Packr can do.
publish.yml
on:
release:
types: [published]
workflow_dispatch:
jobs:
check-bats-version:
runs-on: ubuntu-latest
steps:
- name: Build & Upload Packs
uses: Sindercube/Packr@v2
with:
filename: packr.yml
modrinth-id: 'xxxxxxxx'
curseforge-id: '000000'
github-repo: ${{ github.event.repository.full_name }}
release-name: ${{ github.event.release.name }}
release-version: ${{ github.event.release.tag_name }}
changelog: ${{ github.event.release.body }}
prerelease: ${{ github.event.release.prerelease }}
github-token: ${{ secrets.GITHUB_TOKEN }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} # https://modrinth.com/settings/account
curseforge-token: ${{ secrets.CURSEFORGE_API_TOKEN }} # https://www.curseforge.com/account/api-tokens
To publish your pack to Modrinth or CurseForge, you have to make new MODRINTH_TOKEN
and CURSEFORGE_TOKEN
secrets in your repository's settings in Settings > Secrets & Variables > Actions, then clicking the New Repository Secret button and filling out the data.
For more information, check out the GitHub Secrets documentation.
Name | Description | Required |
---|---|---|
filename |
What YAML file to generate the packs from | True |
release-name |
The name of the release | False |
release-version |
The version of the release | True |
changelog |
The changelog for the release | False |
prerelease |
Whether the release is an early, preview release | False |
github-repo |
The GitHub repository to publish the release to | False |
modrinth-id |
The Modrinth project to publish the release to | False |
curseforge-id |
The CurseForge project to publish the release to | False |
github-token |
The GitHub access token used to publish the release | True (if github-repo is specified) |
modrinth-token |
The Modrinth access token used to publish the release | True (if modrinth-id is specified) |
curseforge-token |
The CurseForge access token used to publish the release | True (if curseforge-id is specified) |
A big Thank You to:
- The Modrinth Team for making Modrinth, the (objectively) best Minecraft content distribution platform.
- Kayra Uylar for making Curserinth, which saved me from having to use 2 different API tokens for CurseForge.
- IntellectualSites for making the CurseForge Version Identifier repository, which also saved me from having to use 2 different API tokens for CurseForge.