Skip to content

Commit

Permalink
Add release workflow, update Gradle version
Browse files Browse the repository at this point in the history
  • Loading branch information
shurik204 committed Jan 21, 2024
1 parent 96ea07d commit df6fdca
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 17 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://github.com/FabricMC/fabric/blob/1.20.4/.github/workflows/release.yml
name: Release
on: [workflow_dispatch] # Manual trigger

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-22.04
container:
image: mcr.microsoft.com/openjdk/jdk:21-ubuntu
options: --user root
steps:
- run: apt update && apt install git -y && git --version
- run: git config --global --add safe.directory /__w/build_dir
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FabricMC/fabric-action-scripts@v2
id: changelog
with:
context: changelog
workflow_id: release.yml
- uses: gradle/wrapper-validation-action@v1
- run: ./gradlew build publishMods --stacktrace -Porg.gradle.parallel.threads=4
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
41 changes: 25 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("fabric-loom") version "1.5-SNAPSHOT" // Fabric Loom
id("io.github.p03w.machete") version "1.1.4" // Build jar compression
id("me.modmuss50.mod-publish-plugin") version "0.4.5" // Mod publishing

`maven-publish` // Maven publishing
java
Expand All @@ -9,6 +10,10 @@ plugins {
version = "${property("minecraft_version")}-${property("mod_version")}-fabric"
group = property("maven_group").toString()

base {
archivesName = "${property("archives_base_name")}"
}

repositories {
maven("https://raw.githubusercontent.com/Fuzss/modresources/main/maven/") // Forge Config API port
maven("https://maven.parchmentmc.org") // Parchment mappings
Expand Down Expand Up @@ -92,8 +97,8 @@ dependencies {
modImplementation("icyllis.modernui:ModernUI-Fabric:${property("minecraft_version")}-${property("modernui_fabric_version")}")

modImplementation(include("teamreborn:energy:${property("tr_energy_version")}") {
exclude(group="net.fabricmc")
exclude(group="net.fabricmc.fabric-api")
exclude("net.fabricmc")
exclude("net.fabricmc.fabric-api")
})

modImplementation(include("me.shurik:simple-chunk-manager:0.2.7")) {}
Expand Down Expand Up @@ -150,20 +155,24 @@ tasks {
}
}

// configure the maven publication
publishing {
// publications {
// mavenJava(MavenPublication) {
// from components.java
// }
// }

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
publishMods {
file = remapJar.get().archiveFile
changelog = providers.environmentVariable("CHANGELOG").getOrElse("No changelog provided")
type = BETA
displayName = "Flux Networks ${property("minecraft_version")} ${this.version} [Fabric]"
modLoaders.add("fabric")
dryRun = true
// dryRun = providers.environmentVariable("CI").getOrNull() == null

curseforge {
accessToken = providers.environmentVariable("CURSEFORGE_API_KEY")
projectId = "962362"
minecraftVersions.add(property("minecraft_version").toString())
}
modrinth {
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
projectId = "d1ItuIJe"
minecraftVersions.add(property("minecraft_version").toString())
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down

0 comments on commit df6fdca

Please sign in to comment.