Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Feb 3, 2024
1 parent 78717a4 commit 60eb99e
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 11 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Release

on:
workflow_dispatch:
release:
types:
- published

permissions:
contents: write

jobs:
Build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 20
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
- uses: gradle/wrapper-validation-action@v1
- run: |
chmod +x gradlew
./gradlew build publishUnified --stacktrace -Porg.gradle.parallel.threads=4
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
}

architectury {
Expand All @@ -9,6 +10,7 @@ architectury {

subprojects {
apply plugin: "dev.architectury.loom"
apply plugin: "me.shedaniel.unified-publishing"

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
Expand Down
3 changes: 2 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ architectury {
common(rootProject.enabled_platforms.split(","))
}

project.archivesBaseName = rootProject.archivesBaseName + "-common"

dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "dev.architectury:architectury:${rootProject.architectury_version}"

implementation "org.quiltmc:quilt-config:${rootProject.quiltconfig_version}"
implementation "org.quiltmc.parsers:json:${project.quiltparsers_version}"
Expand Down
Empty file added fabric/CHANGELOG.md
Empty file.
30 changes: 30 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,33 @@ publishing {
// Add repositories to publish to here.
}
}

unifiedPublishing {
project {
displayName = "[Fabric] $rootProject.version"
releaseType = "alpha"
changelog = file("CHANGELOG.md").getText('UTF-8')
gameVersions = ["1.20", "1.20.1"]
gameLoaders = ["fabric"]

mainPublication remapJar
secondaryPublications.builtBy(sourcesJar)

var CURSEFORGE_TOKEN = project.findProperty("CURSEFORGE_TOKEN") ?: System.getenv("CURSEFORGE_TOKEN")
if (CURSEFORGE_TOKEN != null) {
curseforge {
token = CURSEFORGE_TOKEN
id = rootProject.curseforge_id
}
}

var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN")
if (MODRINTH_TOKEN != null) {
modrinth {
token = MODRINTH_TOKEN
id = rootProject.modrinth_id
version = "$rootProject.version-fabric"
}
}
}
}
3 changes: 1 addition & 2 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
},
"depends": {
"fabric": "*",
"minecraft": ">=1.20",
"architectury": "*"
"minecraft": "1.20.x"
}
}
Empty file added forge/CHANGELOG.md
Empty file.
31 changes: 30 additions & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ configurations {

dependencies {
forge "net.minecraftforge:forge:${rootProject.forge_version}"
modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"

shadowCommon "org.quiltmc:quilt-config:${rootProject.quiltconfig_version}"
shadowCommon "org.quiltmc.parsers:json:${project.quiltparsers_version}"
Expand Down Expand Up @@ -82,3 +81,33 @@ publishing {
// Add repositories to publish to here.
}
}

unifiedPublishing {
project {
displayName = "[Forge] $rootProject.version"
releaseType = "alpha"
changelog = file("CHANGELOG.md").getText('UTF-8')
gameVersions = ["1.20", "1.20.1"]
gameLoaders = ["forge"]

mainPublication remapJar
secondaryPublications.builtBy(sourcesJar)

var CURSEFORGE_TOKEN = project.findProperty("CURSEFORGE_TOKEN") ?: System.getenv("CURSEFORGE_TOKEN")
if (CURSEFORGE_TOKEN != null) {
curseforge {
token = CURSEFORGE_TOKEN
id = rootProject.curseforge_id
}
}

var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN")
if (MODRINTH_TOKEN != null) {
modrinth {
token = MODRINTH_TOKEN
id = rootProject.modrinth_id
version = "$rootProject.version-forge"
}
}
}
}
7 changes: 0 additions & 7 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,4 @@ modId = "minecraft"
mandatory = true
versionRange = "[1.20,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.azusa_config]]
modId = "architectury"
mandatory = true
versionRange = "*"
ordering = "AFTER"
side = "BOTH"

0 comments on commit 60eb99e

Please sign in to comment.