Skip to content

Commit

Permalink
migrate to modmuss50/mod-publish-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MarbleGateKeeper committed Oct 22, 2023
1 parent 1d154d0 commit c65c3f3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 46 deletions.
59 changes: 13 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,28 @@ on: [workflow_dispatch]
permissions:
contents: write

env:
MINECRAFT_VERSION: 1.19.2
JAVA_VERSION: 17
VERSION: 1.2.7.b
CREATE_VERSION: 0.5.1.e

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true

- name: Setup Java
- name: Setup JDK 17
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17

- name: Make Gradle Wrapper Executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
java-version: '17'
distribution: temurin
cache: gradle

- name: Build
run: ./gradlew build
- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v1

- name: Publish (CurseForge/Modrinth)
uses: Kir-Antipov/[email protected]
with:
# Modrinth
modrinth-id: JWGBpFUP
modrinth-featured: true
modrinth-unfeature-mode: subset
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

# CurseForge
curseforge-id: 688768
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

# Config
name: "CEI ${{ env.VERSION }} for Create ${{ env.MINECRAFT_VERSION }}-${{ env.CREATE_VERSION }}"
version: ${{ env.VERSION }}
version-type: release
changelog-file: changelog/${{ env.VERSION }}.md
files: |
build/libs/*-${{ env.VERSION }}!(-@(dev|sources|slim)).jar
loaders: |
forge
game-versions: |
${{ env.MINECRAFT_VERSION }}
dependencies: |
create(required)
java: |
${{ env.JAVA_VERSION }}
retry-attempts: 2
retry-delay: 10000
- name: Build & Release
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew build publishMods
31 changes: 31 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'org.spongepowered.mixin'
id 'org.parchmentmc.librarian.forgegradle'
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "0.3.5"
}

version = mod_version
Expand Down Expand Up @@ -156,6 +157,36 @@ void removeRedundant(jarTask){
jarTask.exclude("assets/create_enchantment_industry/lang/default")
}

publishMods {
file = tasks.jarJar.archiveFile
changelog = new File("changelog/${mod_version}.md").text
version = mod_version
type = STABLE
displayName = "CEI ${mod_version} for Create ${minecraft_version}-${create_version}"
modLoaders.add("forge")
modLoaders.add("neoforge")

curseforge {
projectId = "688768"
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
minecraftVersions.add(minecraft_version)

requires {
slug = "create"
}
}

modrinth {
projectId = "JWGBpFUP"
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersions.add(minecraft_version)

requires {
slug = "create"
}
}
}

jar.finalizedBy('reobfJar')
addLicense(jar)
removeRedundant(jar)
Expand Down

0 comments on commit c65c3f3

Please sign in to comment.