Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JCC workflows #21

Merged
merged 3 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading