Github action to automatically prepare a minecraft world for release.
This github action uses mcwpack
and needs an additional yaml config file inside the repository.
Input | Optional | Description |
---|---|---|
source |
required | The world directory to compress |
target |
required | The target zip file |
config |
defaults to mcwpack.yaml |
The mcwpack config file |
version |
defaults to latest |
The version of mcwpack to install |
archive
- Path to the archive containing the compressed world
Default mcwpack.yaml
:
# Level name (supports minecraft color codes)
name: null
# Directory name inside the archive
dirname: null
# Additional files to pack inside the archive (only when using the zip option)
# extra_files:
# - Readme.md
# - source: ./../anywhere/server.properties
# target: server/server.properties
# Resourcepack directory (or zip archive)
resourcepack: null
# Reset player data in level.dat
reset_player: true
# Archive all non-archived datapacks
zip_datapacks: true
# Remove empty chunks from the world
clean_chunks: true
# Ignored blocks when cleaning chunks (default: minecraft:air)
# The following will delete chunks that only contain air or stone
# ignored_blocks:
# - minecraft:air
# - minecraft:stone
# Filter accepted scores (using glob patterns)
# accepted_scores:
# Filter accepted objectives (using glob patterns)
# accepted_objectives:
# Filter accepted file entries (using glob patterns)
accepted_entries:
- data/*.dat
- datapacks/*
- poi/*.mca
- region/*.mca
- entities/*.mca
- icon.png
- level.dat
⚠️ Most of these examples will require the contents read and write permissions.
Automatically create a release. Uses softprops/action-gh-release
:
name: Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Package
id: package
uses: aksiome/minecraft-package@master
with:
source: path/to/my_world
target: my_compressed_world.zip
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.package.outputs.archive }}
Upload output as an artifact. Uses actions/upload-artifact
:
name: Build
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Package
id: package
uses: aksiome/minecraft-package@master
with:
source: path/to/my_world
target: my_compressed_world.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: My World
path: ${{ steps.package.outputs.archive }}