Skip to content

Release to CurseForge #21

Release to CurseForge

Release to CurseForge #21

# Requires a Release on GitHub of the current version
name: Release to CurseForge
# manually run, or automatically after the GitHub release is done
on:
workflow_dispatch:
workflow_run:
workflows: ["Release to GitHub"]
types:
- completed
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Mod Version
id: get_version
run: echo ::set-output name=version::$(sed -n 's/^modVersion = \(.*\)/\1/p' < gradle.properties*)
- name: Get Mod Name
id: get_mod_name
run: echo ::set-output name=mod_name::$(sed -n 's/^modArchivesBaseName = \(.*\)/\1/p' < gradle.properties*)
- name: Retrieve Jar from Latest Release
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "${{ github.repository }}"
version: "tags/v${{ steps.get_version.outputs.version }}"
file: "${{ steps.get_mod_name.outputs.mod_name }}-${{ steps.get_version.outputs.version }}.jar"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create CurseForge Release
uses: itsmeow/curseforge-upload@v3
with:
game_versions: "Minecraft 1.12:1.12.2,Java 8,Forge"
game_endpoint: "minecraft"
release_type: "release"
changelog: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.get_version.outputs.version }})."
changelog_type: "markdown"
relations: "better-questing:incompatible,better-questing-standard-expansion:incompatible,bqtweaker:incompatible"
file_path: "${{ steps.get_mod_name.outputs.mod_name }}-${{ steps.get_version.outputs.version }}.jar"
project_id: "${{ secrets.CURSEFORGE_PROJECT_ID }}"
token: "${{ secrets.CURSEFORGE_API_KEY }}"