Skip to content

Commit

Permalink
Update loom and misc buildscript fixes (#1864)
Browse files Browse the repository at this point in the history
Fixes sources not being published to maven.
  • Loading branch information
modmuss50 authored Nov 25, 2021
1 parent 6f53a73 commit 6f8dfbb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ jobs:
with:
name: Artifacts
path: ./*/build/libs/
- uses: actions/upload-artifact@v2
with:
name: Maven Local
path: /root/.m2/repository
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Release
on: [workflow_dispatch] # Manual trigger

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-20.04
Expand All @@ -23,6 +27,6 @@ jobs:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
15 changes: 5 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
id "eclipse"
id "idea"
id "maven-publish"
id "fabric-loom" version "0.10.55" apply false
id "fabric-loom" version "0.10.60" apply false
id "org.cadixdev.licenser" version "0.6.1"
id "org.ajoberstar.grgit" version "3.1.0"
id "com.matthewprenger.cursegradle" version "1.4.0"
Expand Down Expand Up @@ -132,9 +132,8 @@ allprojects {
include "**/*.java"
}

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = "sources"
from sourceSets.main.allSource
java {
withSourcesJar()
}

checkstyle {
Expand Down Expand Up @@ -242,10 +241,6 @@ subprojects {
genSourcesWithFernFlower.enabled = false
genSourcesWithCfr.enabled = false
unpickJar.enabled = false

// Work around a loom bug causing empty jars to be pushed to maven local.
publishMavenJavaPublicationToMavenLocal.dependsOn rootProject.tasks.getByName("remapAllJars")
publishMavenJavaPublicationToMavenLocal.dependsOn rootProject.tasks.getByName("remapAllSources")
}
}

Expand Down Expand Up @@ -339,7 +334,7 @@ curseforge {
project {
id = "306612"
changelog = ENV.CHANGELOG ?: "No changelog provided"
releaseType = project.prerelease ? "beta" : "release"
releaseType = project.prerelease as Boolean ? "beta" : "release"
addGameVersion "1.18-Snapshot"
addGameVersion "Fabric"

Expand Down Expand Up @@ -389,7 +384,7 @@ task modrinth(type: com.modrinth.minotaur.TaskModrinthUpload, dependsOn: remapMa
projectId = "P7dR8mSH"
versionNumber = version
versionName = "[$project.minecraft_version] Fabric API $project.version"
releaseType = project.prerelease ? "beta" : "release"
releaseType = project.prerelease as Boolean ? "beta" : "release"
changelog = ENV.CHANGELOG ?: "No changelog provided"

uploadFile = remapJar
Expand Down

0 comments on commit 6f8dfbb

Please sign in to comment.