Skip to content

Commit a7f1903

Browse files
authored
Merge pull request #410 from gradle/gk/ghaSelfTest
Add testing latest changes using Maven Local
2 parents 1429f1d + ae61886 commit a7f1903

File tree

2 files changed

+67
-3
lines changed

2 files changed

+67
-3
lines changed

.github/workflows/build-verification.yml

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,68 @@ jobs:
1818
uses: gradle/actions/setup-gradle@v4
1919
with:
2020
develocity-access-key: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
21-
- name: Build with Gradle
22-
run: ./gradlew build -x signPluginMavenPublication -i -Porg.gradle.java.installations.auto-download=false
21+
- name: Build and publish to Maven Local with Gradle
22+
run: ./gradlew build publishToMavenLocal -x signPluginMavenPublication -i -Porg.gradle.java.installations.auto-download=false
23+
env:
24+
DISABLE_REQUIRED_SIGNING: true
25+
- name: Upload published plugin
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: common-custom-user-data-gradle-plugin
29+
path: ~/.m2/repository/com/gradle
30+
31+
local-test:
32+
name: Test with Locally Published Plugin
33+
runs-on: ubuntu-latest
34+
needs: verification
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
- name: Set up JDK 21
39+
uses: actions/setup-java@v4
40+
with:
41+
java-version: '21'
42+
distribution: 'temurin'
43+
- name: Set up Gradle
44+
uses: gradle/actions/setup-gradle@v4
45+
with:
46+
develocity-access-key: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
47+
- name: Download plugin to maven local
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: common-custom-user-data-gradle-plugin
51+
path: ~/.m2/repository/com/gradle
52+
- name: Create a test project
53+
run: |
54+
echo """
55+
pluginManagement {
56+
repositories {
57+
gradlePluginPortal()
58+
exclusiveContent {
59+
forRepository {
60+
mavenLocal()
61+
}
62+
filter {
63+
includeModule(\"com.gradle\", \"common-custom-user-data-gradle-plugin\")
64+
includeModule(\"com.gradle.common-custom-user-data-gradle-plugin\", \"com.gradle.common-custom-user-data-gradle-plugin.gradle.plugin\")
65+
}
66+
}
67+
}
68+
}
69+
70+
plugins {
71+
id(\"com.gradle.develocity\") version \"4+\"
72+
id(\"com.gradle.common-custom-user-data-gradle-plugin\") version \"2+\"
73+
}
74+
75+
develocity {
76+
server = \"https://ge.solutions-team.gradle.com\"
77+
}
78+
79+
rootProject.name = \"ccud-gradle-integration-test\"
80+
""" > ${{ runner.temp }}/settings.gradle.kts
81+
82+
- name: Run a build with the locally published plugin
83+
id: build-with-local-plugin
84+
run: gradle help
85+
working-directory: ${{ runner.temp }}

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ You may also remove `plugin-publish` and `signing` from the `plugins {}` block a
9191

9292
signing {
9393
// Require publications to be signed on CI. Otherwise, publication will be signed only if keys are provided.
94-
isRequired = providers.environmentVariable("CI").isPresent
94+
isRequired = providers.environmentVariable("CI").isPresent &&
95+
providers.environmentVariable("DISABLE_REQUIRED_SIGNING").isPresent.not()
9596

9697
useInMemoryPgpKeys(
9798
providers.environmentVariable("PGP_SIGNING_KEY").orNull,

0 commit comments

Comments
 (0)