Skip to content

Publish 1.20.1 on GitHub, CurseForge & Modrinth #46

Publish 1.20.1 on GitHub, CurseForge & Modrinth

Publish 1.20.1 on GitHub, CurseForge & Modrinth #46

name: Publish 1.20.1 on GitHub, CurseForge & Modrinth
on: [ workflow_dispatch ]
env:
JAVA_VERSION: 17
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
CURSEFORGE_ID: 1027757
MODRINTH_ID: nR8D9Tc2
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
minecraft_version: ${{ steps.set_output.outputs.minecraft_version }}
mod_version: ${{ steps.set_output.outputs.mod_version }}
steps:
- name: Check Environment Variables
run: env
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17
- name: Download Modern Warfare
uses: Fork-on-the-Table-Collective/[email protected]
with:
credentials: ${{ secrets.GSA_CREDENTIALS }}
actionType: download
localPath: ./forge/jars/cbcmodernwarfare-0.0.5e+mc.1.20.1-forge.jar
googleFileId: 1TJbrEHrX5RQcEkOHHKn6sU1rBWfltues
- name: Download FTB Chunks
uses: Fork-on-the-Table-Collective/[email protected]
with:
credentials: ${{ secrets.GSA_CREDENTIALS }}
actionType: download
localPath: ./common/jars/ftb-chunks-fabric-2001.3.1.jar
googleFileId: 1syotEGMA2svNL2vaXp35yF7fD9NyDmZp
- name: Download Presence Footsteps Forge
uses: Fork-on-the-Table-Collective/[email protected]
with:
credentials: ${{ secrets.GSA_CREDENTIALS }}
actionType: download
localPath: ./forge/jars/PresenceFootsteps-1.20.1-1.9.1-beta.1.jar
googleFileId: 1p-GREqHqYlaQsIJ7cjEydxJYgqSyHgBb
- name: Make Gradle Wrapper Executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build
run: ./gradlew clean build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: artifact
path: |
./common/build/libs/*
./fabric/build/libs/*
./forge/build/libs/*
./CHANGELOG.md
publish:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
platform: [ Fabric, Forge ]
fail-fast: false
steps:
- name: Check Environment Variables
run: |
env
platform=${{ matrix.platform }}
lowercase=$(echo "$platform" | tr '[:upper:]' '[:lower:]')
echo "LOWERCASE=$lowercase" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Read mod_version from gradle.properties
id: read_mod_version
run: |
MOD_VERSION=$(grep 'mod_version' gradle.properties | cut -d'=' -f2)
echo "MOD_VERSION=$MOD_VERSION" >> $GITHUB_ENV
MINECRAFT_VERSION=$(grep 'minecraft_version' gradle.properties | cut -d'=' -f2)
echo "MINECRAFT_VERSION=$MINECRAFT_VERSION" >> $GITHUB_ENV
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: artifact
- name: Publish ${{ matrix.platform }} (CurseForge/Modrinth/GitHub)
uses: Kir-Antipov/[email protected]
with:
curseforge-id: ${{env.CURSEFORGE_ID}}
curseforge-token: "${{env.CURSEFORGE_TOKEN}}"
github-tag: "v${{env.MOD_VERSION}}"
github-token: "${{env.GITHUB_TOKEN}}"
name: "[${{env.MINECRAFT_VERSION}} ${{ matrix.platform }}] ${{env.MOD_VERSION}}"
version: "${{env.MINECRAFT_VERSION}}-${{ env.LOWERCASE }}-${{env.MOD_VERSION}}"
version-type: beta
changelog-file: CHANGELOG.md
files: |
${{ env.LOWERCASE }}/build/libs/!(*-@(dev|sources|javadoc|dev-shadow)).jar
loaders: ${{ env.LOWERCASE }}
game-versions: "${{env.MINECRAFT_VERSION}}"
java: "${{env.JAVA_VERSION}}"
- name: Publish ${{ matrix.platform }} (CurseForge/Modrinth/GitHub)
uses: Kir-Antipov/[email protected]
with:
modrinth-id: ${{env.MODRINTH_ID}}
modrinth-token: "${{env.MODRINTH_TOKEN}}"
name: "[${{env.MINECRAFT_VERSION}} ${{ matrix.platform }}] ${{env.MOD_VERSION}}"
version: "${{env.MINECRAFT_VERSION}}-${{ env.LOWERCASE }}-${{env.MOD_VERSION}}"
version-type: beta
changelog-file: CHANGELOG.md
files: |
${{ env.LOWERCASE }}/build/libs/!(*-@(dev|sources|javadoc|dev-shadow)).jar
loaders: ${{ env.LOWERCASE }}
game-versions: "${{env.MINECRAFT_VERSION}}"
java: "${{env.JAVA_VERSION}}"