Skip to content

Commit

Permalink
Add JCC workflows (#21)
Browse files Browse the repository at this point in the history
Also adds Java 21 to the JDK list.
  • Loading branch information
Matyrobbrt authored Apr 20, 2024
1 parent f18030a commit a65628b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sourceSets {
}

group 'net.neoforged.gradleutils'
version '3.0.0-alpha.12'
version '3.0.0-alpha.13'

repositories {
mavenCentral()
Expand Down
5 changes: 3 additions & 2 deletions src/actionsTemplate/resources/.github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
java: ${ jdkVersion in ['8', '11', '17', '21'] ? jdkVersion : '17' }
gradle_tasks: ${ project.tasks.findByName('test')?.enabled ? 'test' : 'build' }
jar_compatibility: ${ withJCC ? 'true' : 'false' }
17 changes: 17 additions & 0 deletions src/actionsTemplate/resources/.github/workflows/publish-jcc.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
}

0 comments on commit a65628b

Please sign in to comment.