Add CurseForge plugin
This commit is contained in:
48
.github/workflows/release.yml
vendored
48
.github/workflows/release.yml
vendored
@@ -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:
|
||||
|
||||
20
build.gradle
20
build.gradle
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user