From 9da32a9099879815dbb1966f373724476e9cb72c Mon Sep 17 00:00:00 2001 From: Matyrobbrt <65940752+Matyrobbrt@users.noreply.github.com> Date: Sat, 16 Dec 2023 23:02:52 +0200 Subject: [PATCH] 1.20.1 actions (#394) --- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/ISSUE_TEMPLATE/issue_report.md | 10 +- .github/stale.yml | 43 ----- .github/workflows/build-prs.yml | 2 + .github/workflows/release.yml | 30 ++++ .teamcity/pom.xml | 104 ----------- .teamcity/settings.kts | 200 ---------------------- build.gradle | 19 +- 8 files changed, 53 insertions(+), 357 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .teamcity/pom.xml delete mode 100644 .teamcity/settings.kts diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 3fb3fd7e7f..85337569e1 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Want to request a feature? title: '' -labels: Feature +labels: enhancement assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/issue_report.md b/.github/ISSUE_TEMPLATE/issue_report.md index 9095acc8f3..37fb30988f 100644 --- a/.github/ISSUE_TEMPLATE/issue_report.md +++ b/.github/ISSUE_TEMPLATE/issue_report.md @@ -1,20 +1,20 @@ --- name: Issue report -about: Visit the forum first for issues with crashes. +about: Visit the discord first for issues with crashes. title: '' -labels: Triage +labels: triage assignees: '' --- - - + + **Minecraft Version:** {Minecraft version} -**Forge Version:** {Forge version. *Version number, not latest/rb*} +**NeoForge Version:** {NeoForge version. *Version number, not latest/rb*} **Logs:** {Link(s) to GitHub Gist with full latest.log and/or crash report} diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 984e392f0c..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Label to use when marking as stale -staleLabel: Stale -# Comment to post when removing the stale label. Set to `false` to disable -unmarkComment: false -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 1 -# Issues with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - Assigned - -pulls: - # Number of days of inactivity before a Pull Request becomes stale - daysUntilStale: 60 - # Number of days of inactivity before a stale Pull Request is closed - daysUntilClose: 14 - # Comment to post when marking as stale. Set to `false` to disable - markComment: > - This pull request has been automatically marked as stale because it has not had recent - activity, and will be closed if no further activity occurs. If this pull request was - overlooked, forgotten, or should remain open for any other reason, please reply - here to call attention to it and remove the stale status. Thank you for your contributions. - # Comment to post when closing a stale Pull Request. Set to `false` to disable - closeComment: > - This pull request has been automatically closed because it has not had - recent activity. Please feel free to update or reopen it. -issues: - # Number of days of inactivity before an Issue becomes stale - daysUntilStale: 180 - # Number of days of inactivity before a stale Issue is closed - daysUntilClose: 14 - # Comment to post when marking as stale. Set to `false` to disable - markComment: > - This issue has been automatically marked as stale because it has not had activity - in a long time. If this issue is still relevant and should remain open, please reply - with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." - or "Here's a screenshot of this issue on the latest version"). - Thank you for your contributions! - # Comment to post when closing a stale Issue. Set to `false` to disable - closeComment: > - This issue has been automatically closed because it has not had - activity in a long time. Please feel free to reopen it or create a new issue. diff --git a/.github/workflows/build-prs.yml b/.github/workflows/build-prs.yml index 54241536dc..e43cc51996 100644 --- a/.github/workflows/build-prs.yml +++ b/.github/workflows/build-prs.yml @@ -7,6 +7,7 @@ on: - opened - ready_for_review - reopened + workflow_dispatch: jobs: build: @@ -34,6 +35,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: setup + cache-read-only: false - name: Build with Gradle uses: gradle/gradle-build-action@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..1ff2c0af36 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release + +on: + push: + branches: + - '1.*' + +permissions: + contents: read + statuses: write + +jobs: + release: + uses: neoforged/actions/.github/workflows/gradle-publish.yml@main + with: + java: 17 + pre_gradle_tasks: setup + gradle_tasks: publish + # Unlike on 1.20.2+, 1.20.1 still uses the 'old' versioning scheme + # version_labels: -beta, -stable + + # We only publish the main repository. This way we avoid publishing Kits + if: ${{ github.repository == 'neoforged/NeoForge' }} + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + GPG_SUBKEY: ${{ secrets.GPG_SUBKEY }} + GPG_SUBKEY_ID: ${{ secrets.GPG_SUBKEY_ID }} + GPG_SUBKEY_PASSWORD: ${{ secrets.GPG_SUBKEY_PASSWORD }} 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 abba35d29b..0000000000 --- a/.teamcity/settings.kts +++ /dev/null @@ -1,200 +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) - buildType(PullRequestPatchModifications) - - params { - text("docker_jdk_version", "17", 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.5.1", 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.20.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", "NeoForge", 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_FML_ARTIFACT_ID", "fmlonly", label = "Published fmlonly artifact id", description = "The maven coordinate artifact id for fml only that has been published by this build. Can not be empty.", allowEmpty = false) - text("env.PUBLISHED_JAVA_FML_ARTIFACT_VERSION", "0.0.0-SNAPSHOT", label = "Published fmlonly artifact version", description = "The version for fml only that has been published by this build. Can not be empty.", allowEmpty = false) - text("env.PUBLISHED_JAVA_GROUP", "net.neoforged", 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.KEYSTORE_URL", "credentialsJSON:a7ae1c82-8058-4061-8d12-7f6bc2618d2e", display = ParameterDisplay.HIDDEN) - password("env.KEYSTORE_PASSWORD", "credentialsJSON:d7b964e3-a1fd-47a8-b892-6f601fe47479", display = ParameterDisplay.HIDDEN) - text("additional_publishing_gradle_parameters", "-PcrowdinKey=%env.CROWDIN_KEY% -PkeystoreKeyPass=%env.KEYSTORE_PASSWORD% -PkeystoreStorePass=%env.KEYSTORE_PASSWORD% -Pkeystore=%env.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." - - features { - feature { - id = "trigger_fml_only_files_generator" - type = "triggerBuildFeature" - param("triggers", "MinecraftForge_FilesGenerator_GeneratePages") - param("parameters", """ - env.PUBLISHED_JAVA_FML_ARTIFACT_ID~env.PUBLISHED_JAVA_ARTIFACT_ID - env.PUBLISHED_JAVA_FML_ARTIFACT_VERSION~env.PUBLISHED_JAVA_ARTIFACT_VERSION - env.PUBLISHED_JAVA_GROUP - """.trimIndent()) - } - } -}) - -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/(main*) - -:refs/heads/(master*) - -:refs/heads/(develop|release|staging|main|master) - -:refs/heads/(1.*) - +: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) - } -}) - -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 { - param("git_branch_spec", "") - } - - 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" - - params { - param("git_branch_spec", "") - } - - steps { - gradle { - name = "Check" - id = "RUNNER_10_Check" - - tasks = "checkAll" - gradleParams = "--continue %gradle_custom_args%" - enableStacktrace = true - } - } -}) - -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" - - params { - param("git_branch_spec", "") - } - - steps { - gradle { - name = "Validate" - id = "RUNNER_10_Compatibility" - - tasks = "checkJarCompatibility" - gradleParams = "--continue %gradle_custom_args%" - enableStacktrace = true - } - } -}) - -object PullRequestPatchModifications : BuildType({ - templates(AbsoluteId("MinecraftForge_BuildPullRequests"), AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_SetupProjectUsingGradle")) - id("MinecraftForge_MinecraftForge__PullRequestPatchModifications") - name = "Pull Requests (Patch Correctness)" - description = "Validates initial patch correctness" - - params { - param("git_branch_spec", "") - } - - steps { - gradle { - name = "Validate" - id = "RUNNER_10_Compatibility" - - tasks = ":forge:genPatches failGitChanges" - gradleParams = "--continue %gradle_custom_args%" - enableStacktrace = true - } - } -}) diff --git a/build.gradle b/build.gradle index ce89dc4752..91e809ba89 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ import org.objectweb.asm.Opcodes plugins { id 'org.cadixdev.licenser' version '0.6.1' id 'com.github.ben-manes.versions' version '0.46.0' - id 'net.minecraftforge.gradleutils' version '[2.0.13,)' + id 'net.neoforged.gradleutils' version '3.0.0-alpha.8' id 'eclipse' id 'de.undercouch.download' version '5.4.0' id 'net.neoforged.gradle.patcher' version '[6.0.12,6.2)' apply false @@ -34,6 +34,13 @@ plugins { Util.init() //Init all our extension methods! +gradleutils.version { + branches { + suffixBranch = true + suffixExemptedBranch '1.20.1' + } +} + ext { JAR_SIGNER = null if (project.hasProperty('keystore')) { @@ -81,7 +88,7 @@ ext { COMMONS_IO_VERSION = '2.11.0' GIT_INFO = gradleutils.gitInfo - VERSION = gradleutils.getFilteredMCTagOffsetBranchVersion(true, '[0-9]', MC_VERSION) + VERSION = gradleutils.version.toString() FORGE_VERSION = VERSION.substring(MC_VERSION.length() + 1) BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.1.1:fatjar' @@ -91,8 +98,10 @@ ext { MIN_TAG_FOR_CHANGELOG = '41.0' } +logger.lifecycle('NeoForge version: {}', VERSION) + changelog { - fromTag MIN_TAG_FOR_CHANGELOG + from MIN_TAG_FOR_CHANGELOG } def extraTxts = [ @@ -140,6 +149,8 @@ subprojects { group = 'net.neoforged' version = VERSION + rootProject.gradleutils.setupSigning(project: project, signAllPublications: true) + ext { isNonStable = { String version -> def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { ver -> version.toUpperCase().contains(ver) } @@ -206,7 +217,7 @@ subprojects { } } repositories { - maven gradleutils.getPublishingForgeMaven() + maven gradleutils.publishingMaven } }