Skip to content

Commit

Permalink
enable curse publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
eerussianguy committed Aug 31, 2022
1 parent f7cc29f commit 46d7966
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,12 @@ jobs:
asset_path: ./build/libs/firmalife-${{ steps.version.outputs.result }}.jar
asset_name: firmalife-${{ steps.version.outputs.result }}.jar
asset_content_type: application/java-archive
- name: Publish
id: publish
if: ${{ steps.version_type.outputs.result != 'alpha' && success() }}
uses: gradle/gradle-build-action@v2
with:
arguments: curseforge
env:
VERSION: ${{ steps.version.outputs.result }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
30 changes: 29 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ buildscript {
}


plugins {
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'idea'
}

apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'org.spongepowered.mixin'
Expand Down Expand Up @@ -187,3 +191,27 @@ publishing {
}
}
}

curseforge {
final String envApiKey = System.getenv('CURSEFORGE_API_KEY');
final String versionType = project.version.contains('beta') ? 'beta' : (project.version.contains('alpha') ? 'alpha' : 'release')

apiKey = envApiKey == null ? 'nope' : envApiKey

project {
id = '453394'
changelog = "[Changelog ${version}](https://github.com/eerussianguy/firmalife/releases/tag/v${project.version})"
changelogType = "markdown"

releaseType = versionType
addGameVersion "${minecraft_version}"

mainArtifact jar

relations {
requiredDependency 'patchouli'
requiredDependency 'terrafirmacraft'
optionalDependency 'jei'
}
}
}

0 comments on commit 46d7966

Please sign in to comment.