Publish on GitHub, CurseForge & Modrinth #2
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
name: Publish on GitHub, CurseForge & Modrinth | |
on: | |
workflow_dispatch: | |
inputs: | |
changelog: | |
required: true | |
type: string | |
description: The changelog for this version | |
mod_version: | |
required: true | |
type: number | |
description: The mod version | |
minecraft_version: | |
required: true | |
type: number | |
description: The game version supported by this mod version | |
env: | |
JAVA_VERSION: 21 | |
VERSION: ${{ github.event.inputs.mod_version }}+${{ github.event.inputs.minecraft_version }} | |
RELEASE_NAME: Discord Verifier $ {{ env.VERSION }} | |
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }} | |
CURSEFORGE_TOKEN: ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
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: $ {{ env.JAVA_VERSION }} | |
- name: Make Gradle Wrapper Executable | |
if: ${{ runner.os != 'Windows' }} | |
run: chmod +x ./gradlew | |
- name: Build | |
run: ./gradlew clean build | |
- name: Publish (CurseForge/Modrinth/GitHub) | |
uses: Kir-Antipov/[email protected] | |
with: | |
curseforge-id: 1088831 | |
curseforge-token: "${{env.CURSEFORGE_TOKEN}}" | |
modrinth-id: CjGsjuQx | |
modrinth-token: "${{env.MODRINTH_TOKEN}}" | |
github-tag: "v${{env.VERSION}}" | |
github-token: "${{env.GITHUB_TOKEN}}" | |
name: "${{env.RELEASE_NAME}}" | |
version: "${{env.VERSION}}" | |
version-type: release | |
loaders: fabric | |
java: "${{env.JAVA_VERSION}}" |