Skip to content

Release

Release #1

Workflow file for this run

# Pretty much all of this is basically 1-to-1 from HexDummy, I don't know how to write workflows ;-;
name: Release
on:
workflow_dispatch:
inputs:
publish_github:
description: Publish to GitHub
type: boolean
default: true
publish_curseforge:
description: Publish to Curseforge
type: boolean
default: true
publish_modrinth:
description: Publish to Modrinth
type: boolean
default: true
dry_run:
description: Perform a dry run
type: boolean
default: false
jobs:
build:
uses: ./.github/workflows/build.yml
permissions:
contents: write
with:
skip_tests: true
publish-mod:
needs: build
if: inputs.publish_curseforge || inputs.publish_modrinth || inputs.publish_github
runs-on: ubuntu-latest
environment:
name: curseforge-modrinth
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v4
- name: Build mod
env:
RELEASE: true
run: ./gradlew build
- name: Publish to GitHub
if: inputs.publish_github
env:
RELEASE: true
DRY_RUN: ${{ inputs.dry_run && 'true' || '' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publishGithub
- name: Publish to CurseForge
if: inputs.publish_curseforge
env:
RELEASE: true
DRY_RUN: ${{ inputs.dry_run && 'true' || '' }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew publishCurseforge
- name: Publish to Modrinth
if: inputs.publish_modrinth
env:
RELEASE: true
DRY_RUN: ${{ inputs.dry_run && 'true' || '' }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew publishModrinth
- name: Upload dry run artifact
if: inputs.dry_run
uses: actions/upload-artifact@v4
with:
name: dry-run
path: '*/build/publishMods'
if-no-files-found: error