Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
- plugin-maven
- all
- lib
- lib-recover
lib_version:
description: 'Existing lib tag version to publish when using lib-recover (e.g. 4.10.3)'
required: false
type: string

jobs:
build:
Expand All @@ -49,9 +54,19 @@ jobs:
ORG_GRADLE_PROJECT_signingInMemoryKeyId: "0xB74EC7C6"
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
steps:
- name: Validate library recovery input
if: "${{ inputs.to_publish == 'lib-recover' }}"
env:
LIB_VERSION: ${{ inputs.lib_version }}
run: |
[[ "$LIB_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || {
echo 'lib-recover requires a released library version, e.g. 4.10.3'
exit 1
}
- uses: actions/checkout@v7
with:
persist-credentials: false
ref: ${{ inputs.to_publish == 'lib-recover' && format('refs/tags/lib/{0}', inputs.lib_version) || github.ref }}
- name: Configure git credentials for JGit
run: |
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${{ secrets.GITHUB_TOKEN }} | base64 -w0)"
Expand Down Expand Up @@ -83,3 +98,28 @@ jobs:
if: "${{ github.event.inputs.to_publish == 'lib' }}"
run: |
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache
- name: Recover library artifacts from an existing tag
if: "${{ inputs.to_publish == 'lib-recover' }}"
env:
LIB_VERSION: ${{ inputs.lib_version }}
run: |
# Verify the build's versions without printing Gradle properties or secrets.
cat > "$RUNNER_TEMP/verify-library-version.gradle" <<'EOF'
gradle.projectsEvaluated {
if (rootProject.name != 'spotless') {
return // Init scripts also run for the included build-logic build.
}
[':lib', ':lib-extra'].each { projectPath ->
def library = rootProject.project(projectPath)
if (library.version.toString() != System.getenv('LIB_VERSION')) {
throw new GradleException("Library version does not match the recovery tag: ${projectPath}")
}
}
}
EOF
# End this build successfully so the publishing plugin uploads its bundle.
# Do not run changelogPush: the version and tag already exist.
./gradlew :lib:publishToMavenCentral :lib-extra:publishToMavenCentral \
-Prelease=true -PmavenCentralDeploymentValidation=PUBLISHED \
--init-script "$RUNNER_TEMP/verify-library-version.gradle" \
--stacktrace --warning-mode all --no-configuration-cache --no-scan
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (

## [Unreleased]

### Fixed
- Add recovery publishing for missing library artifacts from existing release tags. ([#3108](https://github.com/diffplug/spotless/pull/3108))

## [4.10.3] - 2026-09-25

### Changes
Expand Down
3 changes: 3 additions & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (

## [Unreleased]

### Fixed
- Add recovery publishing for missing library artifacts from existing release tags. ([#3108](https://github.com/diffplug/spotless/pull/3108))

## [8.10.3] - 2026-09-25
### Changes
- Generate formatter defaults from version catalog. ([#3045](https://github.com/diffplug/spotless/pull/3045))
Expand Down
3 changes: 3 additions & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (

## [Unreleased]

### Fixed
- Add recovery publishing for missing library artifacts from existing release tags. ([#3108](https://github.com/diffplug/spotless/pull/3108))

## [3.10.3] - 2026-09-25
### Changes
- Generate formatter defaults from version catalog. ([#3045](https://github.com/diffplug/spotless/pull/3045))
Expand Down
Loading