Skip to content
Open
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
49 changes: 0 additions & 49 deletions .github/workflows/post-release.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
if: ${{ steps.release.outputs.release_created }}
with:
persist-credentials: true

- name: Calculate next SNAPSHOT version
id: next
if: ${{ steps.release.outputs.release_created }}
env:
MAJOR: ${{ steps.release.outputs.major }}
MINOR: ${{ steps.release.outputs.minor }}
PATCH: ${{ steps.release.outputs.patch }}
run: |
next_patch=$(( PATCH + 1 ))
echo "snapshot=${MAJOR}.${MINOR}.${next_patch}-SNAPSHOT" >> "$GITHUB_OUTPUT"

- name: Bump version to next SNAPSHOT
if: ${{ steps.release.outputs.release_created }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNAPSHOT: ${{ steps.next.outputs.snapshot }}
run: |
branch="chore/next-snapshot-${SNAPSHOT}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "${branch}"
sed -i "s/^detektExtensionVersion=.*/detektExtensionVersion=${SNAPSHOT}/" gradle.properties
git add gradle.properties
git commit -m "chore: prepare next development version ${SNAPSHOT}"
git push origin "${branch}"
gh pr create \
--title "chore: prepare next development version ${SNAPSHOT}" \
--body "Automated PR to bump version to next development SNAPSHOT after release."
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,16 @@ Merges are always fast-forward. The merged branch should be deleted at the time

Merge commits are reserved for forward-merging release branches that have received patches.

## Release Process

Releases are automated via [release-please](https://github.com/googleapis/release-please):

1. Merge conventional commits to `main`
2. release-please opens or updates a release PR (bumps version in `gradle.properties`)
3. Maintainer reviews and merges the release PR
4. release-please creates a semver tag and GitHub Release with auto-generated notes
5. The publish workflow publishes the release to Maven Central
6. A follow-up PR is automatically created to bump to the next SNAPSHOT version

## Conversation
Please file issues for this extension under github issues.
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ org.gradle.caching=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8
kotlin.code.style=official

# x-release-please-start-version
detektExtensionVersion=2.2.0-SNAPSHOT
# x-release-please-end

POM_NAME=Detekt Extensions
POM_DESCRIPTION=A Detekt Extension Library
27 changes: 9 additions & 18 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@
"include-component-in-tag": false,
"tag-separator": "",
"bump-patch-for-minor-pre-major": false,
"changelog-sections": [
{"type": "feat", "section": "### Added"},
{"type": "fix", "section": "### Fixed"},
{"type": "deps", "section": "### Changed"},
{"type": "chore", "section": "### Changed", "hidden": false}
],
"extra-files": [
{
"type": "generic",
"path": "gradle.properties",
"search": "detektExtensionVersion=\\d+\\.\\d+\\.\\d+(-SNAPSHOT)?",
"replace": "detektExtensionVersion={{version}}"
}
],
"packages": {
".": {
"tag-prefix": "",
"generate-release-notes": true
"packages": {
".": {
"tag-prefix": "",
"extra-files": [
{
"type": "generic",
"path": "gradle.properties"
}
]
}
}
}