diff --git a/.github/workflows/release-all-tools.yml b/.github/workflows/release-all-tools.yml
new file mode 100644
index 000000000..1e9c70f54
--- /dev/null
+++ b/.github/workflows/release-all-tools.yml
@@ -0,0 +1,75 @@
+name: Combined release tools
+
+on:
+ pull_request:
+ paths:
+ - 'releaseAll.sh'
+ - 'scripts/release-all/**'
+ - 'matrix-bom/verifyBomApi.sh'
+ - '.github/workflows/release-all-tools.yml'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ portable-tools:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 40
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: '21'
+ - uses: gradle/actions/setup-gradle@v4
+ - name: Install shell tools
+ shell: bash
+ run: |
+ if [[ "$RUNNER_OS" == macOS ]]; then
+ brew install bash shellcheck
+ else
+ sudo apt-get update
+ sudo apt-get install -y shellcheck
+ fi
+ - name: Prepare Groovy CLI
+ shell: bash
+ run: |
+ mkdir -p "$RUNNER_TEMP/release-cli/bin"
+ cat > "$RUNNER_TEMP/release-cli/pom.xml" <<'XML'
+ 4.0.0
+ release.toolscli1
+
+ org.apache.groovygroovy5.1.1
+ org.apache.groovygroovy-json5.1.1
+ org.apache.groovygroovy-xml5.1.1
+
+ XML
+ mvn -B -f "$RUNNER_TEMP/release-cli/pom.xml" org.apache.maven.plugins:maven-dependency-plugin:3.11.0:copy-dependencies -DoutputDirectory="$RUNNER_TEMP/release-cli/lib"
+ cat > "$RUNNER_TEMP/release-cli/bin/groovy" <<'SH'
+ #!/usr/bin/env bash
+ exec java -cp "$RUNNER_TEMP/release-cli/lib/*" groovy.ui.GroovyMain "$@"
+ SH
+ chmod +x "$RUNNER_TEMP/release-cli/bin/groovy"
+ echo "$RUNNER_TEMP/release-cli/bin" >> "$GITHUB_PATH"
+ - name: Verify portable helpers and workflow
+ shell: bash
+ run: |
+ bash -n releaseAll.sh matrix-bom/verifyBomApi.sh scripts/release-all/preflight.sh
+ shellcheck releaseAll.sh matrix-bom/verifyBomApi.sh scripts/release-all/preflight.sh
+ groovy scripts/release-all/test-tools.groovy .
+ groovy scripts/release-all/test-inventory-inheritance.groovy .
+ groovy scripts/release-all/test-workflow.groovy .
+ - name: Verify BOM workflows on Linux
+ if: runner.os == 'Linux'
+ shell: bash
+ env:
+ RUN_EXTERNAL_TESTS: 'false'
+ RUN_SLOW_TESTS: 'false'
+ GRADLE_OPTS: '-Dorg.gradle.workers.max=2'
+ run: |
+ BOM_VERIFY_REPO="$GITHUB_WORKSPACE/build/releaseAll/bom-verify" bash matrix-bom/verifyBomApi.sh
+ groovy scripts/release-all/test-manifest-verifier.groovy . build/releaseAll/bom-verify
diff --git a/build.gradle b/build.gradle
index a89dccb1b..1580c5cb5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,6 +2,12 @@ plugins {
alias(libs.plugins.benManesVersions) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.alipsaMavenModule)
+ alias(libs.plugins.alipsaNexusRelease) apply false
+}
+
+if (providers.gradleProperty('releaseAllMode').isPresent()) {
+ apply plugin: 'se.alipsa.nexus-release-plugin'
+ nexusReleasePlugin.combinedRelease { }
}
description = "Groovy libraries for working with matrix ([][] data)"
@@ -392,39 +398,61 @@ tasks.register('dependencyUpdates') {
finalizedBy tasks.named('dependencyUpdatesSummary')
}
-tasks.register('latestMavenVersions') {
- description = 'Lists the latest Maven Central version for each published module'
- group = 'Help'
- // Resolve all data at configuration time to satisfy configuration cache
- def modules = []
- subprojects.findAll { it.plugins.hasPlugin('maven-publish') }.each {
- modules << [name: it.name, group: it.group.toString(), artifact: it.name]
- }
- def bomFile = file('matrix-bom/bom.xml')
- if (bomFile.exists()) {
- def bom = new groovy.xml.XmlSlurper().parse(bomFile)
- modules << [name: 'matrix-bom', group: bom.groupId.text(), artifact: bom.artifactId.text()]
+// Each published subproject gets its own latestMavenVersions task from nexus-release-plugin.
+// This task only covers the Maven-built matrix-bom and matrix-all, which Gradle does not model.
+def latestMavenBomVersions = tasks.register('latestMavenBomVersions') {
+ description = 'Lists the latest Maven Central versions of matrix-bom and matrix-all'
+ group = 'help'
+ // Resolve coordinates at configuration time to satisfy the configuration cache.
+ List