Publish mod version #13
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' | |
type: choice | |
default: 'beta' | |
options: | |
- 'release' | |
- 'beta' | |
- 'alpha' | |
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/mc-publish@v3.2 | |
with: | |
curseforge-id: 632327 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
modrinth-id: CuLATCrJ | |
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: InventoryBogoSorter-${{ github.event.inputs.version }} | |
version: ${{ github.event.inputs.version }} | |
version-type: ${{ github.event.inputs.release_type }} | |
changelog: "[Click here](https://github.com/CleanroomMC/InventoryBogoSorter/releases/tag/v${{ github.event.inputs.version }})" | |
loaders: | | |
forge | |
game-versions: | | |
1.12.2 | |
dependencies: | | |
mixin-booter | depends | 8.3 | |
modularui | depends | 2.1.0 | |
railcraft | recommends | * | |
ender-io | recommends | * | |
thermal-expansion | recommends | * | |
draconic-evolution | recommends | * | |
projecte | recommends | * | |
bibliocraft | recommends | * | |
actually-additions | recommends | * | |
iron-chests | recommends | * | |
project-red-exploration | recommends | * | |
immersive-engineering | recommends | * | |
colossal-chests | recommends | * | |
cyclic | recommends | * | |
industrial-craft | recommends | * | |
ic2-classic | recommends | * | |
angry-pixel-the-betweenlands-mod | recommends | * | |
ender-storage-1-8 | recommends | * | |
rustic | recommends | * | |
metalchests | recommends | * | |
charset-storage-chests | recommends | * | |
quark-oddities | recommends | * | |
terrafirmacraft | recommends | * | |
future-mc | recommends | * | |
travelers-backpack | recommends | * | |
energy-control | recommends | * | |
gregtech-ce-unofficial | recommends | * | |
galacticraft-legacy | recommends | * | |
ae2-extended-life | recommends | * | |
simply_backpacks | recommends | 1.4.9 | |
improvedbackpacks | recommends | * | |
expandable-inventory | recommends | * | |
charm | recommends | * | |
java: | | |
8 | |
retry-attempts: 2 |