Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
prepare mod publish
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jan 31, 2024
1 parent 1f84fe4 commit 726ffbb
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 5 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 }}
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.4-SNAPSHOT" apply false
//id 'io.github.juuxel.loom-vineflower' version '1.+' apply false
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
}

architectury {
Expand Down
Empty file added fabric/CHANGELOG.md
Empty file.
40 changes: 38 additions & 2 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "net.darkhax.curseforgegradle" version "1.+"
id "com.modrinth.minotaur" version "2.+"
id "me.shedaniel.unified-publishing"
}

architectury {
Expand Down Expand Up @@ -79,3 +78,40 @@ 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.3", "1.20.4"]
gameLoaders = ["fabric"]

mainPublication remapJar
secondaryPublications.builtBy(sourcesJar)

relations {
depends {
curseforge = "architectury-api"
modrinth = "architectury-api"
}
}

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"
}
}
}
}
Empty file added forge/CHANGELOG.md
Empty file.
40 changes: 38 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "net.darkhax.curseforgegradle" version "1.+"
id "com.modrinth.minotaur" version "2.+"
id "me.shedaniel.unified-publishing"
}

architectury {
Expand Down Expand Up @@ -85,3 +84,40 @@ 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)

relations {
depends {
curseforge = "architectury-api"
modrinth = "architectury-api"
}
}

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"
}
}
}
}
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enabled_platforms=fabric,forge
quilt_mappings=1.20.1+build.23

archives_base_name=ZoomerLibrary
mod_version=0.1.0
mod_version=0.1.1
maven_group=org.thinkingstudio

architectury_version=9.1.12
Expand All @@ -14,3 +14,6 @@ fabric_loader_version=0.15.6
fabric_api_version=0.91.0+1.20.1

forge_version=1.20.1-47.2.20

modrinth_id=M1jKlKtx
curseforge_id=969061

0 comments on commit 726ffbb

Please sign in to comment.