Publish mod version #8
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
# This workflow must be manually triggered. It accepts a version and a release type. | |
# First it sets the version in gradle.properties to the new version and pushes it. | |
# Then it generates a log, based on commits. | |
# After that builds a jar and uploads it to curseforge/modrinth/GitHub releases | |
name: Publish mod version | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Mod version' | |
required: true | |
release_type: | |
description: 'Release type (release, beta, alpha)' | |
default: 'beta' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Check if tag already exists | |
run: | | |
if git rev-parse --verify --quiet "v${{ github.event.inputs.version }}"; then | |
echo "Version ${{ github.event.inputs.version }} already exists, aborting workflow." | |
exit 1 | |
fi | |
- name: Set version | |
run: sed -i "s/mod_version.*=.*/mod_version = ${{ github.event.inputs.version }}/g" gradle.properties | |
- name: Commit and push gradle.properties | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Bump version to ${{ github.event.inputs.version }}" | |
commit_options: "--no-verify" | |
file_pattern: gradle.properties | |
tagging_message: "v${{ github.event.inputs.version }}" | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Publish Minecraft Mods | |
uses: Kir-Antipov/[email protected] | |
with: | |
curseforge-id: 624243 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
modrinth-id: Ecvd12QC | |
modrinth-featured: true | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
github-tag: "v${{ github.event.inputs.version }}" | |
github-generate-changelog: true | |
github-draft: false | |
github-prerelease: false | |
github-token: ${{ secrets.PAT }} | |
files-primary: build/libs/!(*-@(dev|sources|javadoc)).jar | |
files-secondary: build/libs/*-@(dev|sources|javadoc).jar | |
name: ModularUI-${{ github.event.inputs.version }} | |
version: ${{ github.event.inputs.version }} | |
version-type: ${{ github.event.inputs.release_type }} | |
changelog: "[Click here](https://github.com/CleanroomMC/ModularUI/releases/tag/v${{ github.event.inputs.version }})" | |
loaders: | | |
forge | |
game-versions: | | |
1.12.2 | |
dependencies: | | |
mixin-booter | depends | 5.0 | |
jei | recommends | * | |
blur | recommends | * | |
java: | | |
8 | |
retry-attempts: 2 |