diff --git a/.github/workflows/build-prs.yml b/.github/workflows/build-prs.yml new file mode 100644 index 0000000..2fda958 --- /dev/null +++ b/.github/workflows/build-prs.yml @@ -0,0 +1,20 @@ +name: Build and test PRs + +on: + pull_request: + types: + - synchronize + - opened + - ready_for_review + - reopened + push: + branches: + - 'feature/**' + workflow_dispatch: + +jobs: + build: + uses: neoforged/actions/.github/workflows/build-prs.yml@main + with: + java: 17 + gradle_tasks: build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4115f95 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Release + +on: + push: + branches: [ "main" ] + +permissions: + contents: read + statuses: write + +jobs: + release: + uses: neoforged/actions/.github/workflows/gradle-publish.yml@main + with: + java: 17 + pre_gradle_tasks: '' + gradle_tasks: publish + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} \ No newline at end of file diff --git a/.teamcity/pom.xml b/.teamcity/pom.xml deleted file mode 100644 index 96810d6..0000000 --- a/.teamcity/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - 4.0.0 - MinecraftForge_McModLauncher_bootstraplauncher Config DSL Script - MinecraftForge_McModLauncher_bootstraplauncher - MinecraftForge_McModLauncher_bootstraplauncher_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.neoforged.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 fd156a8..0000000 --- a/.teamcity/settings.kts +++ /dev/null @@ -1,61 +0,0 @@ -import jetbrains.buildServer.configs.kotlin.v2019_2.* -import jetbrains.buildServer.configs.kotlin.v2019_2.projectFeatures.githubIssues - -/* -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(PullRequests) - buildType(Build) - - params { - text("git_main_branch", "main", label = "Git Main Branch", description = "The git main or default branch to use in VCS operations.", display = ParameterDisplay.HIDDEN, allowEmpty = false) - text("github_repository_name", "bootstraplauncher", label = "The github repository name. Used to connect to it in VCS Roots.", description = "This is the repository slug on github. So for example `bootstraplauncher` or `MinecraftForge`. It is interpolated into the global VCS Roots.", display = ParameterDisplay.HIDDEN, allowEmpty = false) - text("env.PUBLISHED_JAVA_ARTIFACT_ID", "bootstraplauncher", 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", "cpw.mods", label = "Published group", description = "The maven coordinate group that has been published by this build. Can not be empty.", allowEmpty = false) - } - - features { - githubIssues { - id = "bootstraplauncher__IssueTracker" - displayName = "McModLauncher/bootstraplauncher" - repositoryURL = "https://github.com/McModLauncher/bootstraplauncher" - } - } -} - -object Build : BuildType({ - templates(AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_BuildMainBranches"), AbsoluteId("MinecraftForge_BuildUsingGradle"), AbsoluteId("MinecraftForge_PublishProjectUsingGradle"), AbsoluteId("MinecraftForge_TriggersStaticFilesWebpageGenerator")) - id("bootstraplauncher__Build") - name = "Build" - description = "Builds and Publishes the main branches of the project." -}) - -object PullRequests : BuildType({ - templates(AbsoluteId("MinecraftForge_BuildPullRequests"), AbsoluteId("MinecraftForge_SetupGradleUtilsCiEnvironmen"), AbsoluteId("MinecraftForge_BuildWithDiscordNotifications"), AbsoluteId("MinecraftForge_BuildUsingGradle")) - id("bootstraplauncher__PullRequests") - name = "Pull Requests" - description = "Builds pull requests for the project" -}) diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3a461f7..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,54 +0,0 @@ -library 'forge-shared-library' - -pipeline { - agent { - docker { - image 'gradle:7-jdk16' - args '-v bootstraplaunchergc:/home/gradle/.gradle/' - } - } - environment { - GRADLE_ARGS = '--no-daemon' - } - - stages { - stage('buildandtest') { - steps { - withGradle { - sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test' - gradleVersion(this, 'properties', 'MYVERSION') - } - } - post { - success { - writeChangelog(currentBuild, 'build/changelog.txt') - archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false - } - } - } - stage('publish') { - when { - not { - changeRequest() - } - } - steps { - withCredentials([usernamePassword(credentialsId: 'maven-cpw-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) { - withGradle { - sh './gradlew ${GRADLE_ARGS} publish' - } - } - } - post { - success { - build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote cpw.mods:bootstraplauncher ${env.MYVERSION} latest")], propagate: false, wait: false - } - } - } - } - post { - always { - archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true - } - } -} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1086dfb..c292bdf 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,16 @@ plugins { - id 'net.neoforged.gradleutils' version '[2.0.16,3)' - id 'com.github.ben-manes.versions' version '0.39.0' - id 'org.javamodularity.moduleplugin' version '1.8.10' + id 'eclipse' id 'java-library' id 'maven-publish' - id 'eclipse' + id 'net.neoforged.gradleutils' version '3.0.0-alpha.4' + id 'com.github.ben-manes.versions' version '0.39.0' + id 'org.javamodularity.moduleplugin' version '1.8.10' } group 'cpw.mods' -version = gradleutils.getTagOffsetVersion() -logger.lifecycle("Version: $version") +version = gradleutils.version +logger.lifecycle("Version: {}", version) repositories { mavenLocal() @@ -30,48 +30,32 @@ java { } changelog { - fromTag "0.1" + from '1.1' } jar { manifest { attributes( 'Specification-Title': 'bootstraplauncher', - 'Specification-Vendor': 'neoforged', + 'Specification-Vendor': 'mcmodlauncher', 'Specification-Version': '1', // We are version 1 of ourselves 'Implementation-Title': project.name, - 'Implementation-Version': "${project.version}+${System.getenv("BUILD_NUMBER")?:0}+${gradleutils.gitInfo.branch}.${gradleutils.gitInfo.abbreviatedId}", - 'Implementation-Vendor':'neoforged', - 'Implementation-Timestamp': java.time.Instant.now().toString(), + 'Implementation-Version': "${project.version}+${gradleutils.gitInfo.branch}.${gradleutils.gitInfo.abbreviatedId}", + 'Implementation-Vendor':'mcmodlauncher', 'Git-Commit': gradleutils.gitInfo.abbreviatedId, 'Git-Branch': gradleutils.gitInfo.branch, - 'Build-Number': "${System.getenv("BUILD_NUMBER")?:0}", 'Main-Class': 'cpw.mods.bootstraplauncher.BootstrapLauncher' ) } } -artifacts { - archives jar - archives sourcesJar -} - publishing { publications.register('mavenJava', MavenPublication) { from components.java pom { name = 'Bootstrap launcher' description = 'Allows bootstrapping a modularized environment from a classpath one' - url = 'https://github.com/McModLauncher/bootstraplauncher' - scm { - url = 'https://github.com/McModLauncher/bootstraplauncher' - connection = 'scm:git:git@github.com:McModLauncher/bootstraplauncher.git' - developerConnection = 'scm:git:git@github.com:McModLauncher/bootstraplauncher.git' - } - issueManagement { - system = 'github' - url = 'https://github.com/McModLauncher/bootstraplauncher/issues' - } + pomUtils.githubRepo(it, 'bootstraplauncher', 'McModLauncher') developers { developer { id = 'cpw' @@ -81,7 +65,7 @@ publishing { } } repositories { - maven gradleutils.getPublishingForgeMaven() + maven gradleutils.publishingMaven } } diff --git a/settings.gradle b/settings.gradle index d266259..5391ac7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,13 +1,5 @@ -pluginManagement { - repositories { - gradlePluginPortal() - maven { url = 'https://maven.neoforged.net/releases' } - } -} - plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' } -rootProject.name = 'bootstraplauncher' - +rootProject.name = 'bootstraplauncher' \ No newline at end of file