Skip to content

Commit

Permalink
migrate to mod-publish plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MarbleGateKeeper committed Oct 29, 2024
1 parent 60cb56a commit cbf305e
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 137 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release All
on: [workflow_dispatch]

permissions:
contents: write

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

- name: Setup JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: temurin
cache: gradle

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v1

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build & Release
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew build :neoforge:publishMods :fabric:publishMods
31 changes: 31 additions & 0 deletions .github/workflows/release-fabric-quilt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Fabric & Quilt
on: [workflow_dispatch]

permissions:
contents: write

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

- name: Setup JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: temurin
cache: gradle

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v1

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build & Release
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew build :fabric:publishMods
31 changes: 31 additions & 0 deletions .github/workflows/release-neoforge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Neoforge
on: [workflow_dispatch]

permissions:
contents: write

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

- name: Setup JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: temurin
cache: gradle

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v1

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build & Release
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew build :neoforge:publishMods
136 changes: 0 additions & 136 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id "me.modmuss50.mod-publish-plugin" version "0.7.4"
}


Expand Down
26 changes: 25 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "com.github.johnrengelman.shadow"
id 'com.github.johnrengelman.shadow'
id 'me.modmuss50.mod-publish-plugin'
}

architectury {
Expand Down Expand Up @@ -87,3 +88,26 @@ publishing {
// Add repositories to publish to here.
}
}

publishMods {
file = tasks.remapJar.archiveFile
changelog = rootProject.file("changelog/${mod_version}.md").text
version = mod_version
type = STABLE
displayName = "[Fabric/Quilt] Creeper Firework ${mod_version} for ${minecraft_version}"
modLoaders.add("fabric")
modLoaders.add("quilt")

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

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

3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ fabric_api_version=0.107.0+1.21.3
neoforge_version=21.3.4-beta
yarn_mappings_patch_neoforge_version=1.21+build.4

curseforge_id = 558439
modrinth_id = owUiXPam

22 changes: 22 additions & 0 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'com.github.johnrengelman.shadow'
id 'me.modmuss50.mod-publish-plugin'
}

architectury {
Expand Down Expand Up @@ -64,3 +65,24 @@ remapJar {
input.set shadowJar.archiveFile
}

publishMods {
file = tasks.remapJar.archiveFile
changelog = rootProject.file("changelog/${mod_version}.md").text
version = mod_version
type = STABLE
displayName = "[NeoForge] Creeper Firework ${mod_version} for ${minecraft_version}"
modLoaders.add("neoforge")

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

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

0 comments on commit cbf305e

Please sign in to comment.