Update README.md #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a CI (continuous integration) workflow for Minecraft datapacks. | |
# The purpose of CI is to try to catch bugs before they make it into a release. | |
# If you are using Visual Studio Code, I suggest using SpyglassMC's language tools to do a similar thing. https://github.com/SpyglassMC/Spyglass | |
# You can check out the indvidual actions on their respective GitHub pages. | |
# For those who have used GitHub Actions before, notice how there is an extra complile and upload step. | |
# This is due to how the build-main job checks for errors. Instead of using a script, | |
# such as, /gradlew build, with this being a datapack, it checks the source files instead. (see Check commands and Check JSON.) | |
# This is completely intentional, please do not create a PR changing it! | |
name: CI | |
on: | |
# Allows the workflow to be triggered by pushing or updating a PR, or manually triggered | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build-main: | |
runs-on: ubuntu-latest | |
# Only run on PRs if the source branch is on someone else's repository | |
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | |
steps: | |
# Clones repository so it has access to the files | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
# Checks mcfunction files for errors | |
- name: Check commands | |
uses: mcbeet/check-commands@v1 | |
with: | |
source: . | |
minecraft: "1.20" | |
# Checks JSON for errors | |
- name: Check JSON | |
uses: ocular-d/[email protected] | |
# Uploads an artifact that you can download and use in your Minecraft world | |
- name: Compile and upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: your-datapack v1 | |
path: | | |
data/ | |
pack.mcmeta | |
pack.png | |
# Errors if files aren't found | |
if-no-files-found: error | |
build-packsquash: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Run PackSquash | |
uses: ComunidadAylas/PackSquash-action@v4 | |
with: | |
artifact_name: '[UNZIP ME] your-datapack v1' | |
packsquash_version: latest | |
options: | | |
pack_directory = '.' | |
allow_mods = ['OptiFine'] |