Skip to content

Publish on GitHub, CurseForge & Modrinth #27

Publish on GitHub, CurseForge & Modrinth

Publish on GitHub, CurseForge & Modrinth #27

Workflow file for this run

name: Publish on GitHub, CurseForge & Modrinth
on: [workflow_dispatch]
env:
MINECRAFT_VERSION: 1.18.2
JAVA_VERSION: 17
VERSION: 1.0.3+1.18.2
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
permissions:
contents: write
jobs:
build:
strategy:
matrix:
version:
[
{ dir: "Fabric", loader: "fabric" },
{ dir: "Forge", loader: "forge" },
]
runs-on: "ubuntu-22.04"
steps:
- name: Check Environment Variables
run: env
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17
- name: Make Gradle Wrapper Executable
working-directory: ${{ matrix.version.dir }}
run: chmod +x ./gradlew
- name: Build
working-directory: ${{ matrix.version.dir }}
run: ./gradlew clean build
- name: Remove sources jar
run: rm -f ${{ matrix.version.dir }}/build/libs/*-sources.jar
- name: Capture Build Artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: ${{ matrix.version.dir }}/build/libs/
- name: Publish (CurseForge/Modrinth/GitHub)
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 882715
curseforge-token: "${{env.CURSEFORGE_TOKEN}}"
modrinth-id: oTmCQ7Y1
modrinth-token: "${{env.MODRINTH_TOKEN}}"
github-tag: "v${{env.VERSION}}_${{ matrix.version.dir }}"
github-token: "${{env.GITHUB_TOKEN}}"
name: "${{env.VERSION}}_${{ matrix.version.dir }}"
version: "${{env.VERSION}}"
version-type: release
game-versions: "${{env.MINECRAFT_VERSION}}"
java: "${{env.JAVA_VERSION}}"
files: ${{ matrix.version.dir }}/build/libs/*.jar
loaders: ${{ matrix.version.loader }}