diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000000..db6737c6d8
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,28 @@
+name: Publish
+
+on:
+ push:
+ branches: [ '1.15.x' ]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main
+ with:
+ java: 8
+ gradle_tasks: 'setup build publish'
+ artifact_name: 'forge'
+ secrets:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
+ PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }}
+ PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }}
+ PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }}
+ MAVEN_USER: ${{ secrets.MAVEN_USER }}
+ MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
+ # Unused for now until we upgrade gradle
+ # SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
+ # SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
+ # SIGN_KEYSTORE_PASSWORD: ${{ secrets.SIGN_KEYSTORE_PASSWORD }}
+ # SIGN_KEYSTORE_DATA: ${{ secrets.SIGN_KEYSTORE_DATA }}
\ No newline at end of file
diff --git a/.teamcity/pom.xml b/.teamcity/pom.xml
deleted file mode 100644
index a8a6f382b4..0000000000
--- a/.teamcity/pom.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
- 4.0.0
- MinecraftForge_Forge Config DSL Script
- MinecraftForge_Forge
- MinecraftForge_Forge_dsl
- 1.0-SNAPSHOT
-
-
- org.jetbrains.teamcity
- configs-dsl-kotlin-parent
- 1.0-SNAPSHOT
-
-
-
-
- jetbrains-all
- https://download.jetbrains.com/teamcity-repository
-
- true
-
-
-
- teamcity-server
- https://teamcity.minecraftforge.net/app/dsl-plugins-repository
-
- true
-
-
-
-
-
-
- JetBrains
- https://download.jetbrains.com/teamcity-repository
-
-
-
-
- ${basedir}
-
-
- kotlin-maven-plugin
- org.jetbrains.kotlin
- ${kotlin.version}
-
-
-
-
- compile
- process-sources
-
- compile
-
-
-
- test-compile
- process-test-sources
-
- test-compile
-
-
-
-
-
- org.jetbrains.teamcity
- teamcity-configs-maven-plugin
- ${teamcity.dsl.version}
-
- kotlin
- target/generated-configs
-
-
-
-
-
-
-
- org.jetbrains.teamcity
- configs-dsl-kotlin
- ${teamcity.dsl.version}
- compile
-
-
- org.jetbrains.teamcity
- configs-dsl-kotlin-plugins
- 1.0-SNAPSHOT
- pom
- compile
-
-
- org.jetbrains.kotlin
- kotlin-stdlib-jdk8
- ${kotlin.version}
- compile
-
-
- org.jetbrains.kotlin
- kotlin-script-runtime
- ${kotlin.version}
- compile
-
-
-
\ No newline at end of file
diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts
deleted file mode 100644
index 097e338888..0000000000
--- a/.teamcity/settings.kts
+++ /dev/null
@@ -1,185 +0,0 @@
-import jetbrains.buildServer.configs.kotlin.v2019_2.*
-import jetbrains.buildServer.configs.kotlin.v2019_2.projectFeatures.githubIssues
-import jetbrains.buildServer.configs.kotlin.*
-import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
-
-/*
-The settings script is an entry point for defining a TeamCity
-project hierarchy. The script should contain a single call to the
-project() function with a Project instance or an init function as
-an argument.
-
-VcsRoots, BuildTypes, Templates, and subprojects can be
-registered inside the project using the vcsRoot(), buildType(),
-template(), and subProject() methods respectively.
-
-To debug settings scripts in command-line, run the
-
- mvnDebug org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate
-
-command and attach your debugger to the port 8000.
-
-To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View
--> Tool Windows -> Maven Projects), find the generate task node
-(Plugins -> teamcity-configs -> teamcity-configs:generate), the
-'Debug' option is available in the context menu for the task.
-*/
-
-version = "2021.2"
-
-project {
-
- buildType(Build)
- buildType(BuildSecondaryBranches)
- buildType(PullRequests)
- buildType(PullRequestChecks)
- buildType(PullRequestCompatibility)
-
- params {
- text("docker_jdk_version", "8", label = "Gradle version", description = "The version of the JDK to use during execution of tasks in a JDK.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
- text("docker_gradle_version", "7.3.3", label = "Gradle version", description = "The version of Gradle to use during execution of Gradle tasks.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
- text("git_main_branch", "1.21.x", label = "Git Main Branch", description = "The git main or default branch to use in VCS operations.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
- text("git_branch_spec", """
- +:refs/heads/(main*)
- +:refs/heads/(master*)
- +:refs/heads/(develop|release|staging|main|master)
- +:refs/heads/(1.*)
- """.trimIndent(), label = "The branch specification of the repository", description = "By default all main branches are build by the configuration. Modify this value to adapt the branches build.", display = ParameterDisplay.HIDDEN, allowEmpty = true)
- text("github_repository_name", "MinecraftForge", label = "The github repository name. Used to connect to it in VCS Roots.", description = "This is the repository slug on github. So for example `MinecraftForge` or `MinecraftForge`. It is interpolated into the global VCS Roots.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
- text("env.PUBLISHED_JAVA_ARTIFACT_ID", "forge", label = "Published artifact id", description = "The maven coordinate artifact id that has been published by this build. Can not be empty.", allowEmpty = false)
- text("env.PUBLISHED_JAVA_GROUP", "net.minecraftforge", label = "Published group", description = "The maven coordinate group that has been published by this build. Can not be empty.", allowEmpty = false)
- //These are references and not actually keys
- password("env.CROWDIN_KEY", "credentialsJSON:a3102dbe-805d-4177-9f54-3d2c2eb08fd5", display = ParameterDisplay.HIDDEN)
- password("env.LEGACY_KEYSTORE_URL", "credentialsJSON:a2d2efc7-4492-47b6-9826-d14b2c1243a0", display = ParameterDisplay.HIDDEN)
- password("env.LEGACY_KEYSTORE_PASSWORD", "credentialsJSON:9f9a1a9e-f91b-40d5-b888-8ebc79a99ded", display = ParameterDisplay.HIDDEN)
- text("additional_publishing_gradle_parameters", "-PcrowdinKey=%env.CROWDIN_KEY% -PkeystoreKeyPass=%env.LEGACY_KEYSTORE_PASSWORD% -PkeystoreStorePass=%env.LEGACY_KEYSTORE_PASSWORD% -Pkeystore=%env.LEGACY_KEYSTORE_URL%", label = "Additional gradle parameters for publish", description = "Contains the additional gradle parameters used during publishing.", display = ParameterDisplay.HIDDEN, allowEmpty = true)
-
- checkbox("should_execute_build", "false", label = "Should build", description = "Indicates if the build task should be executed.", display = ParameterDisplay.HIDDEN,
- checked = "true", unchecked = "false")
- checkbox("should_execute_test", "false", label = "Should build", description = "Indicates if the build task should be executed.", display = ParameterDisplay.HIDDEN,
- checked = "true", unchecked = "false")
- }
-
- features {
- githubIssues {
- id = "MinecraftForge_MinecraftForge__IssueTracker"
- displayName = "MinecraftForge/MinecraftForge"
- repositoryURL = "https://github.com/MinecraftForge/MinecraftForge"
- }
- }
-}
-
-object Build : BuildType({
- templates(AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_BuildMainBranches"), AbsoluteId("MinecraftForge_SetupProjectUsingGradle"), AbsoluteId("MinecraftForge_BuildUsingGradle"), AbsoluteId("MinecraftForge_PublishProjectUsingGradle"), AbsoluteId("MinecraftForge_TriggersStaticFilesWebpageGenerator"))
- id("MinecraftForge_MinecraftForge__Build")
- name = "Build"
- description = "Builds and Publishes the main branches of the project."
-})
-
-object BuildSecondaryBranches : BuildType({
- templates(AbsoluteId("MinecraftForge_ExcludesBuildingDefaultBranch"), AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_BuildMainBranches"), AbsoluteId("MinecraftForge_SetupProjectUsingGradle"), AbsoluteId("MinecraftForge_BuildUsingGradle"))
- id("MinecraftForge_MinecraftForge__BuildSecondaryBranches")
- name = "Build - Secondary Branches"
- description = "Builds and Publishes the secondary branches of the project."
- params {
- text("git_branch_spec", """
- +:refs/heads/(*)
- -:refs/heads/noci*
- """.trimIndent(), label = "The branch specification of the repository", description = "By default all main branches are build by the configuration. Modify this value to adapt the branches build.", display = ParameterDisplay.HIDDEN, allowEmpty = true)
- }
- vcs {
- branchFilter = """
- +:*
- -:1.*
- -:
- """.trimIndent()
- }
-})
-
-object PullRequests : BuildType({
- templates(AbsoluteId("MinecraftForge_BuildPullRequests"), AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_SetupProjectUsingGradle"), AbsoluteId("MinecraftForge_BuildUsingGradle"))
- id("MinecraftForge_MinecraftForge__PullRequests")
- name = "Pull Requests"
- description = "Builds pull requests for the project"
-
- params {
- checkbox("should_execute_build", "true", label = "Should build", description = "Indicates if the build task should be executed.", display = ParameterDisplay.HIDDEN,
- checked = "true", unchecked = "false")
- text(
- "gradle_build_task",
- "assemble",
- label = "Gradle build task to execute during build",
- description = "Determines the build task that is executed to build the project.",
- display = ParameterDisplay.HIDDEN,
- allowEmpty = false
- )
- }
-})
-
-object PullRequestChecks : BuildType({
- templates(AbsoluteId("MinecraftForge_BuildPullRequests"), AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_SetupProjectUsingGradle"))
- id("MinecraftForge_MinecraftForge__PullRequestChecks")
- name = "Pull Requests (Checks)"
- description = "Checks pull requests for the project"
-
- steps {
- gradle {
- name = "Check"
- id = "RUNNER_10_Check"
-
- tasks = "checkAll"
- gradleParams = "--continue %gradle_custom_args%"
- enableStacktrace = true
- dockerImage = "%docker_gradle_image%"
- dockerRunParameters = """
- -v "/opt/cache/agent/gradle:/home/gradle/.gradle"
- -v "/opt/cache/shared/gradle:/home/gradle/rocache:ro"
- --network=host
- -u 1000:1000
- %docker_additional_args%
- """.trimIndent()
- }
- }
-
- vcs {
- branchFilter = """
- +:*
- -:1.*
- -:
- """.trimIndent()
- }
-})
-
-object PullRequestCompatibility : BuildType({
- templates(AbsoluteId("MinecraftForge_BuildPullRequests"), AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_SetupProjectUsingGradle"))
- id("MinecraftForge_MinecraftForge__PullRequestCompatibility")
- name = "Pull Requests (Compatibility)"
- description = "Validates binary compatibility for pull requests made to the project"
-
- steps {
- gradle {
- name = "Validate"
- id = "RUNNER_10_Compatibility"
-
- tasks = "checkJarCompatibility"
- gradleParams = "--continue %gradle_custom_args%"
- enableStacktrace = true
- dockerImage = "%docker_gradle_image%"
- dockerRunParameters = """
- -v "/opt/cache/agent/gradle:/home/gradle/.gradle"
- -v "/opt/cache/shared/gradle:/home/gradle/rocache:ro"
- --network=host
- -u 1000:1000
- %docker_additional_args%
- """.trimIndent()
- }
- }
-
- vcs {
- branchFilter = """
- +:*
- -:1.*
- -:
- """.trimIndent()
- }
-})
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 9a52803018..7a1abaaa0a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -48,20 +48,14 @@ plugins {
id 'org.ajoberstar.grgit' version '4.1.1'
id 'de.undercouch.download' version '3.3.0'
id 'com.github.ben-manes.versions' version '0.22.0'
+ // Does not support this old of gradle
+ //id 'net.minecraftforge.gradlejarsigner' version '1.0.5'
}
apply plugin: 'eclipse'
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version'))
ext {
- JAR_SIGNER = null
- if (project.hasProperty('keystore')) {
- JAR_SIGNER = [
- storepass: project.properties.keystoreStorePass,
- keypass: project.properties.keystoreKeyPass,
- keystore: project.properties.keystore
- ]
- }
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20200514-1.15.1'
MC_VERSION = '1.15.2'
@@ -126,8 +120,7 @@ project(':clean') {
}
}
-project(':forge') {
- evaluationDependsOn(':clean')
+project(':forge') {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
@@ -479,48 +472,21 @@ project(':forge') {
if (changelog.exists())
extraTxts += changelog
- task downloadCrowdin() {
- ext {
- output = file('build/crowdin_raw.zip')
- update = file('build/crowdin.json')
- id = 'minecraft-forge'
- }
- onlyIf {
- project.hasProperty('crowdinKey') && !project.gradle.startParameter.isOffline()
- }
- doLast {
- download {
- src "https://api.crowdin.com/api/project/${id}/export?key=${project.crowdinKey}&json"
- dest update
- overwrite true
- }
- if (!update.text.contains('success')) {
- throw new RuntimeException("Crowdin export failed, see ${update} for more info")
- }
- download {
- src "https://api.crowdin.com/api/project/${id}/download/all.zip?key=${project.crowdinKey}"
- dest output
- overwrite true
- }
- }
+
+ tasks.register('downloadCrowdin', Download) {
+ src 'https://files.minecraftforge.net/crowdin.zip'
+ dest file('build/crowdin.zip')
+ onlyIfModified true
+ quiet true
}
task crowdin(type: Zip) {
dependsOn downloadCrowdin
- onlyIf {
- !downloadCrowdin.state.skipped
- }
baseName = project.name
version = project.version
classifier = 'crowdin'
destinationDir = file('build/distributions')
- from(zipTree(downloadCrowdin.output)){
- eachFile { //Tired of waiting for crowdin API, rename things myself. Remove once crowdin stops being dumb
- if (it.name.equals('en_us.json') && !it.path.startsWith('assets/')) {
- it.name = it.path.split('/')[0] + '.json'
- it.path = 'assets/forge/lang/' + it.name
- }
- }
+ from(zipTree(downloadCrowdin.dest)){
exclude { it.isDirectory() }
rename { it.toLowerCase() }//Minecraft needs it lowercase.
exclude '**/*.lang' //Pre-1.13 format
@@ -723,7 +689,7 @@ project(':forge') {
}
}
- task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
+ task launcherJson(dependsOn: ['universalJar', 'launcherJar']) {
inputs.file universalJar.archivePath
inputs.file { launcherJar.archivePath }
ext {
@@ -959,7 +925,7 @@ project(':forge') {
*/
// add crowdin locales
- from { !crowdin.state.skipped ? zipTree(crowdin.archivePath) : null}
+ from zipTree(crowdin.archivePath)
dependsOn crowdin
doFirst {
@@ -1010,7 +976,7 @@ project(':forge') {
changing = true
}
- task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, 'signUniversalJar', 'signLauncherJar']) {
+ task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, universalJar, launcherJar]) {
classifier = 'installer'
extension = 'jar' //Needs to be Zip task to not override Manifest, so set extension
destinationDir = file('build/libs')
@@ -1039,24 +1005,12 @@ project(':forge') {
}
}
- [universalJar, launcherJar, installerJar].each { t ->
- task "sign${t.name.capitalize()}"(type: SignJar, dependsOn: t) {
- onlyIf {
- JAR_SIGNER != null && t.state.failure == null
- }
- def jarsigner = JAR_SIGNER == null ? [:] : JAR_SIGNER
- alias = 'forge'
- storePass = jarsigner.storepass
- keyPass = jarsigner.keypass
- keyStore = jarsigner.keystore
- inputFile = t.archivePath
- outputFile = t.archivePath
- doFirst {
- project.logger.lifecycle('Signing: ' + inputFile)
- }
- }
- t.finalizedBy(tasks.getByName("sign${t.name.capitalize()}"))
- }
+ /*
+ jarSigner.autoDetect()
+ jarSigner.sign(universalJar)
+ jarSigner.sign(launcherJar)
+ jarSigner.sign(installerJar)
+ */
task makeMdk(type: Zip) {
baseName = project.name
@@ -1359,6 +1313,7 @@ def getClasspath(project, libs, artifact) {
//evaluationDependsOnChildren()
task setup() {
+ if (findProject(':clean') != null)
dependsOn ':clean:extractMapped'
dependsOn ':forge:extractMapped' //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
}
diff --git a/settings.gradle b/settings.gradle
index 1f8b5da0aa..795cc1538f 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,10 +1,13 @@
rootProject.name = 'Forge'
include ':mcp'
-include ':clean'
include ':forge'
project(":mcp").projectDir = file("projects/mcp")
-if (false && !System.env.TEAMCITY_VERSION)
-project(":clean").projectDir = file("projects/clean")
project(":forge").projectDir = file("projects/forge")
+
+
+if (false) {
+ include ':clean'
+ project(":clean").projectDir = file("projects/clean")
+}