diff --git a/.github/workflows/build-prs.yml b/.github/workflows/build-prs.yml index 8562457..082c182 100644 --- a/.github/workflows/build-prs.yml +++ b/.github/workflows/build-prs.yml @@ -1,5 +1,5 @@ # File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly -# The template can be found at https://github.com/neoforged/GradleUtils/blob/287df22f683ed8422bc93deb9eb4a62099cc061f/src/actionsTemplate/resources/.github/workflows/build-prs.yml +# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/build-prs.yml name: Build and test PRs @@ -20,4 +20,5 @@ jobs: uses: neoforged/actions/.github/workflows/build-prs.yml@main with: java: 17 - gradle_tasks: test \ No newline at end of file + gradle_tasks: test + jar_compatibility: false diff --git a/.github/workflows/publish-jcc.yml b/.github/workflows/publish-jcc.yml new file mode 100644 index 0000000..b2d6028 --- /dev/null +++ b/.github/workflows/publish-jcc.yml @@ -0,0 +1,20 @@ +# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly +# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/publish-jcc.yml + +name: Publish PR JCC output + +on: + workflow_run: + workflows: [Build and test PRs] + types: + - completed + +jobs: + publish-jcc: + if: 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/.github/workflows/publish-prs.yml b/.github/workflows/publish-prs.yml index bd3d140..9bb92b4 100644 --- a/.github/workflows/publish-prs.yml +++ b/.github/workflows/publish-prs.yml @@ -1,5 +1,5 @@ # File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly -# The template can be found at https://github.com/neoforged/GradleUtils/blob/287df22f683ed8422bc93deb9eb4a62099cc061f/src/actionsTemplate/resources/.github/workflows/publish-prs.yml +# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/publish-prs.yml name: Publish PRs to GitHub Packages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df41cf3..6d9f4a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ # File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly -# The template can be found at https://github.com/neoforged/GradleUtils/blob/287df22f683ed8422bc93deb9eb4a62099cc061f/src/actionsTemplate/resources/.github/workflows/release.yml +# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/release.yml name: Release @@ -17,12 +17,13 @@ jobs: with: java: 17 pre_gradle_tasks: test - gradle_tasks: publish + gradle_tasks: publish closeAndReleaseSonatypeStagingRepository secrets: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} MAVEN_USER: ${{ secrets.MAVEN_USER }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} GPG_SUBKEY: ${{ secrets.GPG_SUBKEY }} GPG_SUBKEY_ID: ${{ secrets.GPG_SUBKEY_ID }} GPG_SUBKEY_PASSWORD: ${{ secrets.GPG_SUBKEY_PASSWORD }} - \ No newline at end of file diff --git a/api/build.gradle b/api/build.gradle index b80d944..cc03fd5 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -1,5 +1,8 @@ +import net.neoforged.gradleutils.PomUtilsExtension + plugins { id 'java-library' + id 'maven-publish' id 'net.neoforged.gradleutils' } @@ -8,6 +11,10 @@ group = 'net.neoforged.jst' gradleutils { setupSigning(project: project, signAllPublications: true) } +java { + withSourcesJar() + withJavadocJar() +} dependencies { api "com.jetbrains.intellij.java:java-psi-impl:$intellij_version" @@ -21,6 +28,13 @@ publishing { artifactId = 'jst-api' from components.java + pom { + name = 'JST API' + description = 'The JavaSourceTransformer API' + rootProject.pomUtils.githubRepo(it, 'JavaSourceTransformer') + rootProject.pomUtils.neoForgedDeveloper(it) + rootProject.pomUtils.license(it, PomUtilsExtension.License.LGPL_v2) + } } } repositories { diff --git a/build.gradle b/build.gradle index d84659d..1d0102a 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,11 @@ plugins { } group = "net.neoforged.jst" -gradleutils.version { - branches.suffixBranch() +gradleutils { + setupCentralPublishing() + version { + branches.suffixBranch() + } } project.version = gradleutils.version diff --git a/cli/build.gradle b/cli/build.gradle index 36e7382..c6e8c03 100644 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -1,3 +1,5 @@ +import net.neoforged.gradleutils.PomUtilsExtension + plugins { id 'java' id 'com.github.johnrengelman.shadow' @@ -14,6 +16,10 @@ jar { } gradleutils.setupSigning(project: project, signAllPublications: true) +java { + withSourcesJar() + withJavadocJar() +} configurations { shadow @@ -52,6 +58,15 @@ components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElemen skip() } +tasks.register('sourcesBundleJar', Jar) { + it.archiveClassifier = 'sources' + it.archiveBaseName = 'jst-cli-bundle' +} +tasks.register('javadocBundleJar', Jar) { + it.archiveClassifier = 'javadoc' + it.archiveBaseName = 'jst-cli-bundle' +} + publishing { publications { // This publication only contains the unshaded jar with dependencies in the pom.xml @@ -59,12 +74,29 @@ publishing { artifactId = 'jst-cli' from components.java + pom { + name = 'JST CLI' + description = 'The JavaSourceTransformer CLI' + rootProject.pomUtils.githubRepo(it, 'JavaSourceTransformer') + rootProject.pomUtils.neoForgedDeveloper(it) + rootProject.pomUtils.license(it, PomUtilsExtension.License.LGPL_v2) + } } // This publication only contains the shaded standalone jar - bundle(MavenPublication) { + create('bundle', MavenPublication) { artifactId = 'jst-cli-bundle' project.shadow.component(bundle) + artifact(tasks.sourcesBundleJar) + artifact(tasks.javadocBundleJar) + + pom { + name = 'JST CLI bundle' + description = 'The JavaSourceTransformer CLI bundle, containing all builtin plugins shadowed' + rootProject.pomUtils.githubRepo(it, 'JavaSourceTransformer') + rootProject.pomUtils.neoForgedDeveloper(it) + rootProject.pomUtils.license(it, PomUtilsExtension.License.LGPL_v2) + } } } repositories {