Skip to content

Publish

Publish #39

Workflow file for this run

name: Publish
on:
pull_request:
types:
- closed
branches:
- master
- 1_20_2
workflow_dispatch:
env:
MINECRAFT_VERSION: 1.20.5
JAVA_VERSION: 21
VERSION: 5.2.1+1.20.5
VERSION_TYPE: alpha
permissions:
contents: write
jobs:
build:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' # @AnthonyWC on GH, https://github.com/orgs/community/discussions/26724#discussioncomment-3253096
runs-on: ubuntu-latest
steps:
- name: Check Environment Variables
run: env
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Java
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
- name: Make Gradle Wrapper Executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Datagen
run: ./gradlew runDatagen
- name: Copy Datagen
run: mkdir -p src/main/generated/data/mystical/ && cp -r src/main/generated/assets/mystical/lang src/main/generated/data/mystical/
- name: Upload Generated Data
uses: actions/upload-artifact@v4
with:
name: GeneratedData
path: src/main/generated/
overwrite: true
- name: Build
run: ./gradlew build
- name: Upload JAR Artifacts
uses: actions/upload-artifact@v4
with:
name: JARs
path: build/libs/*
- name: Game Test
run: mkdir build/gametest && echo "eula=true" >> build/gametest/eula.txt && ./gradlew runGameTest # ty modmuss
- name: Publish
uses: Kir-Antipov/[email protected]
with:
version-type: ${{ env.VERSION_TYPE }}
modrinth-id: ibmeD85j
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-tag: "v${{ env.VERSION }}"
github-token: ${{ secrets.GH_TOKEN }}
changelog-file: CHANGELOG.md
game-versions: "${{ env.MINECRAFT_VERSION }}"
java: "${{ env.JAVA_VERSION }}"