Add CurseForge plugin

This commit is contained in:
raoulvdberge
2021-12-12 23:28:43 +01:00
parent 0906b51b99
commit 548c77252f
2 changed files with 47 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get tag name
- name: Get tag name
uses: olegtarasov/get-tag@v2.1
id: tagName
- name: Validate semver
@@ -47,26 +47,32 @@ jobs:
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: 'Unreleased'
path: ./CHANGELOG.md
- name: Release on GitHub
uses: softprops/action-gh-release@v1
id: ghRelease
with:
body: ${{ steps.changelog_reader.outputs.changes }}
name: ${{ steps.tagName.outputs.tag }}
files: |
build/libs/*.jar
# This is necessary because the Discord action doesn't support GH actions variable expansion?
- name: Set release URL
run: |
echo "RELEASE_URL=${{ steps.ghRelease.outputs.url }}" >> $GITHUB_ENV
- name: Notify Discord
uses: Ilshidur/action-discord@0.3.2
with:
args: 'Refined Storage {{ GIT_TAG_NAME }} has been released! {{ RELEASE_URL }}'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
version: 'Unreleased'
path: ./CHANGELOG.md
- name: Release on GitHub
uses: softprops/action-gh-release@v1
id: ghRelease
with:
body: ${{ steps.changelog_reader.outputs.changes }}
name: ${{ steps.tagName.outputs.tag }}
files: |
build/libs/*.jar
- name: Release on CurseForge
run: ./gradlew curseforge
env:
RELEASE: ${{ steps.tagName.outputs.tag }}
CHANGELOG: ${{ steps.changelog_reader.outputs.changes }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
# This is necessary because the Discord action doesn't support GH actions variable expansion?
- name: Set release URL
run: |
echo "RELEASE_URL=${{ steps.ghRelease.outputs.url }}" >> $GITHUB_ENV
- name: Notify Discord
uses: Ilshidur/action-discord@0.3.2
with:
args: 'Refined Storage {{ GIT_TAG_NAME }} has been released! {{ RELEASE_URL }}'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Twitter
uses: ethomson/send-tweet-action@v1
with:

View File

@@ -8,6 +8,10 @@ buildscript {
}
}
plugins {
id 'com.matthewprenger.cursegradle' version '1.4.0'
}
repositories {
maven {
url = "https://dvs1.progwml6.com/files/maven/"
@@ -125,6 +129,22 @@ jar {
}
}
if (System.getenv("CURSEFORGE_TOKEN") != null) {
curseforge {
apiKey = System.getenv("CURSEFORGE_TOKEN")
project {
id = '243076'
changelog = System.getenv("CHANGELOG")
changelogType = 'markdown'
releaseType = project.version.toString().contains('beta') ? 'beta' : (project.version.toString().contains('alpha') ? 'alpha' : 'release')
mainArtifact(jar) {
displayName = "v$project.version"
}
}
}
}
jar.finalizedBy('reobfJar')
publishing {