Skip to content

Commit ebd4c61

Browse files
Latest build conv (#326)
1 parent 85e01fc commit ebd4c61

File tree

6 files changed

+39
-27
lines changed

6 files changed

+39
-27
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 # v3.5.0
3131
- name: Fetch version history
3232
# Do NOT want to fetch all tags if building a specific tag.
33-
# Doing so could result in code published with wrong version, if newer tags have been pushed
33+
# Doing so could result in code published with the wrong version if newer tags have been pushed
3434
if: (!startsWith(github.ref, 'refs/tags/'))
3535
run: git fetch --tag --unshallow
3636
- name: Set up JDK
@@ -39,23 +39,26 @@ jobs:
3939
java-version: '17'
4040
distribution: 'adopt'
4141
- name: Setup Gradle
42-
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
42+
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
4343
with:
4444
gradle-home-cache-cleanup: true
4545
- name: Build
4646
env:
4747
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
48+
CI_NAME: github-actions
49+
CI_JOB_ID: ${{ github.run_id }}
50+
CI_PULL_REQUEST: ${{ github.event.pull_request.number }}
4851
run: ./gradlew build coveralls
4952
- name: Upload Reports
5053
if: failure()
51-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
54+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5255
with:
5356
name: reports-linux
5457
path: '**/build/reports/**/*.xml'
5558
retention-days: 5
5659
- name: Upload Test Results
5760
if: failure()
58-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
61+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5962
with:
6063
name: test-results-linux
6164
path: '**/build/test-results/**/*.xml'
@@ -69,8 +72,7 @@ jobs:
6972
ORG_GRADLE_PROJECT_SONA_PASSWORD: ${{ secrets.SONA_PASSWORD }}
7073
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7174
run: |
72-
./gradlew cV
73-
./gradlew publish closeAndReleaseStagingRepository
75+
./gradlew publish closeAndReleaseStagingRepositories
7476
- name: Publish to Gradle Plugins Portal
7577
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-alpha')
7678
env:
@@ -87,27 +89,31 @@ jobs:
8789
steps:
8890
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8991
- uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 # v3.5.0
92+
- name: Fetch version history
93+
# Do NOT want to fetch all tags if building a specific tag, as it will fail
94+
if: (!startsWith(github.ref, 'refs/tags/'))
95+
run: git fetch --tag --unshallow
9096
- name: Set up JDK
9197
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
9298
with:
9399
java-version: '17'
94100
distribution: 'adopt'
95101
- name: Setup Gradle
96-
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
102+
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
97103
with:
98104
gradle-home-cache-cleanup: true
99105
- name: Build
100106
run: ./gradlew.bat build -PexcludeContainerised
101-
- name: Upload Reports
107+
- name: Upload reports
102108
if: failure()
103-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
109+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
104110
with:
105111
name: reports-win
106112
path: '**/build/reports/**/*.xml'
107113
retention-days: 5
108114
- name: Upload Test Results
109115
if: failure()
110-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
116+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
111117
with:
112118
name: test-results-win
113119
path: '**/build/test-results/**/*.xml'

buildSrc/settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17+
plugins {
18+
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
19+
}

buildSrc/src/main/kotlin/creek-common-convention.gradle.kts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
* <p>Apply to all java modules, usually excluding the root project in multi-module sets.
2121
*
2222
* <p>Versions:
23+
* - 1.13: indentWithSpaces -> leadingTabsToSpaces and a few others
2324
* - 1.12: XML reporting for spotbugs
2425
* - 1.11: Add explicit checkstyle tool version
25-
* - 1.10: Add ability to exclude containerised tests
26+
* - 1.10: Add the ability to exclude containerised tests
2627
* - 1.9: Add `allDeps` task.
2728
* - 1.8: Tweak test config to reduce build speed.
28-
* - 1.7: Switch to setting Java version via toolchain
29+
* - 1.7: Switch to setting the Java version via toolchain
2930
* - 1.6: Remove GitHub packages for snapshots
3031
* - 1.5: Add filters to exclude generated sources
3132
* - 1.4: Add findsecbugs-plugin
@@ -50,7 +51,7 @@ repositories {
5051
mavenCentral()
5152

5253
maven {
53-
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
54+
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
5455
mavenContent {
5556
includeGroup("org.creekservice")
5657
snapshotsOnly()
@@ -59,12 +60,12 @@ repositories {
5960
}
6061

6162
dependencies {
62-
spotbugsPlugins("com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0")
63-
checkstyle("com.puppycrawl.tools:checkstyle:10.17.0")
63+
spotbugsPlugins("com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0")
64+
checkstyle("com.puppycrawl.tools:checkstyle:10.26.1")
6465
}
6566

6667
configurations.all {
67-
// Reduce chance of build servers running into compilation issues due to stale snapshots:
68+
// Reduce the chance of build servers running into compilation issues due to stale snapshots:
6869
resolutionStrategy.cacheChangingModulesFor(15, TimeUnit.MINUTES)
6970
}
7071

@@ -80,7 +81,7 @@ tasks.test {
8081
}
8182
}
8283

83-
setForkEvery(5)
84+
forkEvery = 5
8485
maxParallelForks = Runtime.getRuntime().availableProcessors()
8586
testLogging {
8687
showStandardStreams = true
@@ -94,7 +95,7 @@ tasks.test {
9495
spotless {
9596
java {
9697
googleJavaFormat("1.15.0").aosp().reflowLongStrings()
97-
indentWithSpaces()
98+
leadingTabsToSpaces()
9899
importOrder()
99100
removeUnusedImports()
100101
trimTrailingWhitespace()

buildSrc/src/main/kotlin/creek-plugin-publishing-convention.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* <p>Versions:
2121
* - 1.6: Correct automatic module name
2222
* - 1.5: Switch to using `gradlePlugin`, as required by Gradle 8.0
23-
* - 1.4: Fix website URL to avoid redirect
23+
* - 1.4: Fix website URL to avoid redirect
2424
* - 1.3: Switch to setting 'system' from issue-management
2525
*
2626
* <p>Apply this plugin to any module publishing a Gradle plugin.

buildSrc/src/main/kotlin/creek-publishing-convention.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
/**
1818
* Standard configuration for Creek library publishing
1919
*
20-
* <p>Version: 1.2
20+
* <p>Version: 1.3
21+
* - 1.3: Switch to setting 'system' from issue-management
2122
*
2223
* <p> Apply this plugin only to subprojects if in multi-module setup.
2324
*
@@ -113,7 +114,7 @@ publishing {
113114
}
114115

115116
issueManagement {
116-
name.set("GitHub issues")
117+
system.set("GitHub issues")
117118
url.set("https://github.com/creek-service/${rootProject.name}/issues")
118119
}
119120
}

buildSrc/src/main/kotlin/creek-sonatype-publishing-convention.gradle.kts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@
1515
*/
1616

1717
/**
18-
* Standard configuration for Creek library publishing to Maven Central vis SonaType OSSRH
18+
* Standard configuration for Creek library publishing to Maven Central viq the portal
1919
*
20-
* <p>Version: 1.1
20+
* <p>Version: 1.2
2121
*
2222
* <p>Apply this plugin only to the root project if in multi-module setup.
2323
*
24-
* @see <a href="https://s01.oss.sonatype.org/">OSSHR Nexus Service</a>
24+
* @see <a href="https://central.sonatype.com/publishing">Maven Central Portal</a>
2525
*/
2626

2727
plugins {
2828
id("io.github.gradle-nexus.publish-plugin")
2929
}
3030

3131
nexusPublishing {
32+
packageGroup = "org.creekservice"
33+
3234
repositories {
3335
sonatype {
34-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
35-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
36-
stagingProfileId.set("89a20518f39cd")
36+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
37+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
3738

3839
if (project.hasProperty("SONA_USERNAME")) {
3940
username.set(project.property("SONA_USERNAME").toString())

0 commit comments

Comments
 (0)