Skip to content

Commit 2e1ac47

Browse files
committed
Merge branch 'gradle-publishing' into gradle-runner-final
2 parents 79a7229 + 5fb43b6 commit 2e1ac47

File tree

4 files changed

+57
-5
lines changed

4 files changed

+57
-5
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,43 @@ jobs:
7474

7575
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
7676
ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }}
77+
78+
publish-gradle:
79+
name: Publish Processing Plugins to Gradle Plugin Portal
80+
runs-on: ubuntu-latest
81+
needs: version
82+
steps:
83+
- name: Checkout Repository
84+
uses: actions/checkout@v4
85+
86+
- name: Setup Processing
87+
uses: ./.github/actions/setup
88+
89+
- name: Publish plugins to Gradle Plugin Portal
90+
run: ./gradlew publishPlugins
91+
env:
92+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
93+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
94+
95+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
96+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
97+
98+
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
99+
ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }}
100+
101+
- name: Publish internal plugins to Gradle Plugin Portal
102+
run: ./gradlew -c gradle/plugins/settings.gradle.kts publishPlugins
103+
env:
104+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
105+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
106+
107+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
108+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
109+
110+
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
111+
ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }}
112+
ORG_GRADLE_PROJECT_publishingGroup: ${{ vars.GRADLE_GROUP }}
113+
77114
release-windows:
78115
name: (windows/${{ matrix.arch }}) Create Processing Release
79116
runs-on: ${{ matrix.os }}

gradle/plugins/library/build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
plugins {
2-
`java-gradle-plugin`
2+
id("com.gradle.plugin-publish") version "2.0.0"
33
kotlin("jvm") version "2.2.20"
44
}
55

66
gradlePlugin {
7+
website = "https://processing.org/"
8+
vcsUrl = "https://github.com/processing/processing4"
79
plugins {
810
create("processing.library") {
9-
id = "org.processing.library"
11+
id = project.properties.getOrElse("publishingGroup", { "org.processing" }).toString() + ".library"
12+
displayName = "Processing Library Plugin"
13+
description = "Gradle plugin for building Processing libraries"
14+
tags = listOf("processing", "library", "dsl")
1015
implementationClass = "ProcessingLibraryPlugin"
1116
}
1217
}

java/gradle/build.gradle.kts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,20 @@ dependencies{
2121
testImplementation(libs.junit)
2222
}
2323

24-
// TODO: CI/CD for publishing the plugin to the Gradle Plugin Portal
2524
gradlePlugin{
25+
website = "https://processing.org/"
26+
vcsUrl = "https://github.com/processing/processing4"
2627
plugins{
2728
create("processing.java"){
28-
id = "org.processing.java"
29+
id = "$group.java"
30+
displayName = "Processing Plugin"
31+
description = "Gradle plugin for building Processing sketches"
32+
tags = listOf("processing", "sketch", "dsl")
2933
implementationClass = "org.processing.java.gradle.ProcessingPlugin"
3034
}
3135
}
3236
}
37+
3338
publishing{
3439
repositories{
3540
mavenLocal()
@@ -38,4 +43,9 @@ publishing{
3843
url = uri(project(":app").layout.buildDirectory.dir("resources-bundled/common/repository").get().asFile.absolutePath)
3944
}
4045
}
46+
}
47+
// Grab the group before running tests, since the group is used in the test configuration and may be modified by the publishing configuration
48+
val testGroup = group.toString()
49+
tasks.withType<Test>().configureEach {
50+
systemProperty("project.group", testGroup)
4151
}

java/gradle/src/test/kotlin/ProcessingPluginTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ProcessingPluginTest{
2020
val sketchFolder = directory.newFolder("sketch")
2121
directory.newFile("sketch/build.gradle.kts").writeText("""
2222
plugins {
23-
id("org.processing.java")
23+
id("${System.getProperty("project.group")}.java")
2424
}
2525
""".trimIndent())
2626
directory.newFile("sketch/settings.gradle.kts")

0 commit comments

Comments
 (0)