Skip to content

Publish Release

Publish Release #1

Workflow file for this run

name: Publish Release
on:
workflow_dispatch:
inputs:
close_milestone:
description: "Close milestone"
required: true
type: boolean
default: true
upload_backups:
description: "Upload to backups server"
required: true
type: boolean
default: true
publish_github:
description: "Publish to GitHub"
required: true
type: boolean
default: true
publish_curseforge:
description: "Publish to CurseForge"
required: true
type: boolean
default: true
jobs:
publish:
runs-on: ubuntu-latest
env:
WI_BACKUPS_API_KEY: ${{ secrets.WI_BACKUPS_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "microsoft"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Extract version
id: version
run: |
MOD_VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d ' ')
TAG_VERSION="v${MOD_VERSION%%-*}"
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
git config --global user.name "Wurst-Bot"
git config --global user.email "[email protected]"
git tag ${{ steps.version.outputs.tag_version }}
git push origin ${{ steps.version.outputs.tag_version }}
- name: Close milestone
if: ${{ inputs.close_milestone }}
run: ./gradlew closeMilestone --stacktrace
- name: Build
run: ./gradlew build --stacktrace
- name: Upload backups
if: ${{ inputs.upload_backups }}
run: ./gradlew uploadBackups --stacktrace
- name: Publish to GitHub
if: ${{ inputs.publish_github }}
run: ./gradlew github --stacktrace
- name: Publish to CurseForge
if: ${{ inputs.publish_curseforge }}
run: ./gradlew publishCurseforge --stacktrace