diff --git a/.build/deploy.sh b/.build/deploy.sh index a9cf4f8..286d7b6 100644 --- a/.build/deploy.sh +++ b/.build/deploy.sh @@ -22,6 +22,6 @@ gpg --fast-import --no-tty --batch --yes eliorona-sign.asc echo "📦 Publishing..." -./gradlew uploadArchives +./gradlew uploadArchives -Psign=true echo "✅ Done!" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fae2f9a..b1eb6ba 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,8 +18,9 @@ jobs: java-version: 1.8 - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew bintrayUpload --parallel --stacktrace + - name: Grant execute permission for deploy script + run: chmod +x .build/deploy.sh + - name: Deploy with Gradle + run: ./.build/deploy.sh env: - BINTRAY_USER: oroarmor - BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} \ No newline at end of file + GPG_SECRET: ${{ secrets.GPG_SECRET }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8f2b2fe..3ddd7ff 100644 --- a/build.gradle +++ b/build.gradle @@ -22,12 +22,8 @@ subprojects { mappings "net.fabricmc:yarn:1.16.5+build.4" } - remapJar { - classifier project.name - } - task sourceJar(type: Jar) { - classifier project.name + "-sources" + classifier "sources" from sourceSets.main.allSource } @@ -42,12 +38,13 @@ subprojects { } tasks.withType(Sign) { - onlyIf { gradle.taskGraph.hasTask("publish") && project.hasProperty("sign") } + onlyIf { project.hasProperty("sign") } } + println(project.hasProperty("sign")) + if(project.hasProperty("sign")) { signing { - required { gradle.taskGraph.hasTask("publish") && project.hasProperty("sign") } useGpgCmd() sign configurations.archives } diff --git a/fabric/build.gradle b/fabric/build.gradle index c3e3faf..a3034af 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -17,6 +17,10 @@ configurations { shadowCommon } +archivesBaseName = rootProject.archives_base_name + "-fabric" +version = rootProject.mod_version +group = rootProject.maven_group + dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" @@ -55,7 +59,6 @@ shadowJar { remapJar { input.set shadowJar.archiveFile dependsOn shadowJar - classifier "fabric" } jar { @@ -75,7 +78,6 @@ sourcesJar { publishing { publications { mavenFabric(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name // add all the jars that should be included when publishing to maven artifact(remapJar) { classifier null diff --git a/forge/build.gradle b/forge/build.gradle index b6673aa..49b8dfb 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -20,6 +20,10 @@ artifacts { dev(jar) } +archivesBaseName = rootProject.archives_base_name + "-forge" +version = rootProject.mod_version +group = rootProject.maven_group + dependencies { forge "net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}" // Remove the next line if you don't want to depend on the API @@ -48,7 +52,6 @@ shadowJar { remapJar { input.set shadowJar.archiveFile dependsOn shadowJar - classifier "forge" manifest { getAttributes()["FMLModType"] = "LIBRARY" @@ -76,7 +79,6 @@ sourcesJar { publishing { publications { mavenForge(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name // add all the jars that should be included when publishing to maven artifact(remapJar) { classifier null