Skip to content

Commit 5c322ce

Browse files
committed
Fix publishing
1 parent c5cf393 commit 5c322ce

File tree

7 files changed

+80
-9
lines changed

7 files changed

+80
-9
lines changed

.github/workflows/build-prs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
2-
# The template can be found at https://github.com/neoforged/GradleUtils/blob/287df22f683ed8422bc93deb9eb4a62099cc061f/src/actionsTemplate/resources/.github/workflows/build-prs.yml
2+
# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/build-prs.yml
33

44
name: Build and test PRs
55

@@ -20,4 +20,5 @@ jobs:
2020
uses: neoforged/actions/.github/workflows/build-prs.yml@main
2121
with:
2222
java: 17
23-
gradle_tasks: test
23+
gradle_tasks: test
24+
jar_compatibility: false

.github/workflows/publish-jcc.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
2+
# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/publish-jcc.yml
3+
4+
name: Publish PR JCC output
5+
6+
on:
7+
workflow_run:
8+
workflows: [Build and test PRs]
9+
types:
10+
- completed
11+
12+
jobs:
13+
publish-jcc:
14+
if: false # Option not enabled when the workflows were generated
15+
uses: neoforged/actions/.github/workflows/publish-jcc.yml@main
16+
with:
17+
beta_version_pattern: .* # Change this line if there's a clear point at which a version no longer accepts breaking changes
18+
secrets:
19+
JCC_GH_APP_ID: ${{ secrets.JCC_GH_APP_ID }}
20+
JCC_GH_APP_KEY: ${{ secrets.JCC_GH_APP_KEY }}

.github/workflows/publish-prs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
2-
# The template can be found at https://github.com/neoforged/GradleUtils/blob/287df22f683ed8422bc93deb9eb4a62099cc061f/src/actionsTemplate/resources/.github/workflows/publish-prs.yml
2+
# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/publish-prs.yml
33

44
name: Publish PRs to GitHub Packages
55

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
2-
# The template can be found at https://github.com/neoforged/GradleUtils/blob/287df22f683ed8422bc93deb9eb4a62099cc061f/src/actionsTemplate/resources/.github/workflows/release.yml
2+
# The template can be found at https://github.com/neoforged/GradleUtils/blob/72be0f55ce3f6e91f89cfd7847143b9ef1dcc3e9/src/actionsTemplate/resources/.github/workflows/release.yml
33

44
name: Release
55

@@ -17,12 +17,13 @@ jobs:
1717
with:
1818
java: 17
1919
pre_gradle_tasks: test
20-
gradle_tasks: publish
20+
gradle_tasks: publish closeAndReleaseSonatypeStagingRepository
2121
secrets:
2222
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
2323
MAVEN_USER: ${{ secrets.MAVEN_USER }}
2424
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
25+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
26+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
2527
GPG_SUBKEY: ${{ secrets.GPG_SUBKEY }}
2628
GPG_SUBKEY_ID: ${{ secrets.GPG_SUBKEY_ID }}
2729
GPG_SUBKEY_PASSWORD: ${{ secrets.GPG_SUBKEY_PASSWORD }}
28-

api/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import net.neoforged.gradleutils.PomUtilsExtension
2+
13
plugins {
24
id 'java-library'
5+
id 'maven-publish'
36
id 'net.neoforged.gradleutils'
47
}
58

@@ -8,6 +11,10 @@ group = 'net.neoforged.jst'
811
gradleutils {
912
setupSigning(project: project, signAllPublications: true)
1013
}
14+
java {
15+
withSourcesJar()
16+
withJavadocJar()
17+
}
1118

1219
dependencies {
1320
api "com.jetbrains.intellij.java:java-psi-impl:$intellij_version"
@@ -21,6 +28,13 @@ publishing {
2128
artifactId = 'jst-api'
2229

2330
from components.java
31+
pom {
32+
name = 'JST API'
33+
description = 'The JavaSourceTransformer API'
34+
rootProject.pomUtils.githubRepo(it, 'JavaSourceTransformer')
35+
rootProject.pomUtils.neoForgedDeveloper(it)
36+
rootProject.pomUtils.license(it, PomUtilsExtension.License.LGPL_v2)
37+
}
2438
}
2539
}
2640
repositories {

build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ plugins {
55
}
66

77
group = "net.neoforged.jst"
8-
gradleutils.version {
9-
branches.suffixBranch()
8+
gradleutils {
9+
setupCentralPublishing()
10+
version {
11+
branches.suffixBranch()
12+
}
1013
}
1114
project.version = gradleutils.version
1215

cli/build.gradle

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import net.neoforged.gradleutils.PomUtilsExtension
2+
13
plugins {
24
id 'java'
35
id 'com.github.johnrengelman.shadow'
@@ -14,6 +16,10 @@ jar {
1416
}
1517

1618
gradleutils.setupSigning(project: project, signAllPublications: true)
19+
java {
20+
withSourcesJar()
21+
withJavadocJar()
22+
}
1723

1824
configurations {
1925
shadow
@@ -52,19 +58,45 @@ components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElemen
5258
skip()
5359
}
5460

61+
tasks.register('sourcesBundleJar', Jar) {
62+
it.archiveClassifier = 'sources'
63+
it.archiveBaseName = 'jst-cli-bundle'
64+
}
65+
tasks.register('javadocBundleJar', Jar) {
66+
it.archiveClassifier = 'javadoc'
67+
it.archiveBaseName = 'jst-cli-bundle'
68+
}
69+
5570
publishing {
5671
publications {
5772
// This publication only contains the unshaded jar with dependencies in the pom.xml
5873
plain(MavenPublication) {
5974
artifactId = 'jst-cli'
6075

6176
from components.java
77+
pom {
78+
name = 'JST CLI'
79+
description = 'The JavaSourceTransformer CLI'
80+
rootProject.pomUtils.githubRepo(it, 'JavaSourceTransformer')
81+
rootProject.pomUtils.neoForgedDeveloper(it)
82+
rootProject.pomUtils.license(it, PomUtilsExtension.License.LGPL_v2)
83+
}
6284
}
6385
// This publication only contains the shaded standalone jar
64-
bundle(MavenPublication) {
86+
create('bundle', MavenPublication) {
6587
artifactId = 'jst-cli-bundle'
6688

6789
project.shadow.component(bundle)
90+
artifact(tasks.sourcesBundleJar)
91+
artifact(tasks.javadocBundleJar)
92+
93+
pom {
94+
name = 'JST CLI bundle'
95+
description = 'The JavaSourceTransformer CLI bundle, containing all builtin plugins shadowed'
96+
rootProject.pomUtils.githubRepo(it, 'JavaSourceTransformer')
97+
rootProject.pomUtils.neoForgedDeveloper(it)
98+
rootProject.pomUtils.license(it, PomUtilsExtension.License.LGPL_v2)
99+
}
68100
}
69101
}
70102
repositories {

0 commit comments

Comments
 (0)