diff --git a/build.gradle b/build.gradle index 06d5199..1ec82c7 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ sourceSets { } group 'net.neoforged.gradleutils' -version '3.0.0-alpha.12' +version '3.0.0-alpha.13' repositories { mavenCentral() diff --git a/src/actionsTemplate/resources/.github/workflows/build-prs.yml b/src/actionsTemplate/resources/.github/workflows/build-prs.yml index 284c040..6fb1777 100644 --- a/src/actionsTemplate/resources/.github/workflows/build-prs.yml +++ b/src/actionsTemplate/resources/.github/workflows/build-prs.yml @@ -16,5 +16,6 @@ jobs: build: uses: neoforged/actions/.github/workflows/build-prs.yml@main with: - java: ${ jdkVersion in ['8', '11', '17'] ? jdkVersion : '17' } - gradle_tasks: ${ project.tasks.findByName('test')?.enabled ? 'test' : 'build' } \ No newline at end of file + java: ${ jdkVersion in ['8', '11', '17', '21'] ? jdkVersion : '17' } + gradle_tasks: ${ project.tasks.findByName('test')?.enabled ? 'test' : 'build' } + jar_compatibility: ${ withJCC ? 'true' : 'false' } diff --git a/src/actionsTemplate/resources/.github/workflows/publish-jcc.yml b/src/actionsTemplate/resources/.github/workflows/publish-jcc.yml new file mode 100644 index 0000000..d3f7ac8 --- /dev/null +++ b/src/actionsTemplate/resources/.github/workflows/publish-jcc.yml @@ -0,0 +1,17 @@ +name: Publish PR JCC output + +on: + workflow_run: + workflows: [Build and test PRs] + types: + - completed + +jobs: + publish-jcc: + if: ${ withJCC ? 'true' : 'false # Option not enabled when the workflows were generated' } + uses: neoforged/actions/.github/workflows/publish-jcc.yml@main + with: + beta_version_pattern: .* # Change this line if there's a clear point at which a version no longer accepts breaking changes + secrets: + JCC_GH_APP_ID: \${{ secrets.JCC_GH_APP_ID }} + JCC_GH_APP_KEY: \${{ secrets.JCC_GH_APP_KEY }} diff --git a/src/actionsTemplate/resources/.github/workflows/release.yml b/src/actionsTemplate/resources/.github/workflows/release.yml index c629648..803c53e 100644 --- a/src/actionsTemplate/resources/.github/workflows/release.yml +++ b/src/actionsTemplate/resources/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release: uses: neoforged/actions/.github/workflows/gradle-publish.yml@main with: - java: ${ jdkVersion in ['8', '11', '17'] ? jdkVersion : '17' } + java: ${ jdkVersion in ['8', '11', '17', '21'] ? jdkVersion : '17' } pre_gradle_tasks: ${ project.tasks.findByName('test')?.enabled ? 'test' : "''" } gradle_tasks: publish ${ project.plugins.hasPlugin('io.github.gradle-nexus.publish-plugin') ? 'closeAndReleaseSonatypeStagingRepository' : '' } secrets: diff --git a/src/main/groovy/net/neoforged/gradleutils/tasks/ExtractActionsWorkflowsTask.java b/src/main/groovy/net/neoforged/gradleutils/tasks/ExtractActionsWorkflowsTask.java index 5d68d3b..64b1232 100644 --- a/src/main/groovy/net/neoforged/gradleutils/tasks/ExtractActionsWorkflowsTask.java +++ b/src/main/groovy/net/neoforged/gradleutils/tasks/ExtractActionsWorkflowsTask.java @@ -51,6 +51,7 @@ protected void extractZip(final String fileZip, final File destDir) throws Excep .collect(Collectors.toList()) )); binding.put("withPRPublishing", withPRPublishing); + binding.put("withJCC", withJCC); // Use the Implementation-Version attribute to store the git commit final String gitCommit = ExtractActionsWorkflowsTask.class.getPackage().getImplementationVersion(); @@ -91,15 +92,25 @@ protected void extractZip(final String fileZip, final File destDir) throws Excep zis.close(); } - private boolean withPRPublishing; + private boolean withPRPublishing, withJCC; @Input public boolean getWithPRPublishing() { return this.withPRPublishing; } + @Input + public boolean getWithJCC() { + return this.withJCC; + } + @Option(option = "pr-publishing", description = "If the workflow for publishing PRs should be enabled") public void setWithPRPublishing(boolean withPRPublishing) { this.withPRPublishing = withPRPublishing; } + + @Option(option = "jcc", description = "If the workflow for JarCompatibilityChecker should be enabled") + public void setWithJCC(boolean withJCC) { + this.withJCC = withJCC; + } }