ci: add cocogitto for conventional commits and automated releases

- Add cog.toml with commit type configs and version bump hooks
- Add .woodpecker.yml pipeline for automated version bumping on main
- Add Version element to csproj for cog to update
- Document cog workflow in CLAUDE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Barry Walker
2026-01-24 15:07:50 -05:00
parent 162033fecf
commit 7aa8fddea8
4 changed files with 133 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
when:
- event: push
branch: main
steps:
- name: release
image: alpine:latest
# Skip if this is a version bump commit (prevents infinite loop)
when:
- evaluate: 'CI_COMMIT_MESSAGE not contains "chore(release):"'
commands:
# Install dependencies
- apk add --no-cache git curl perl
# Install Cocogitto
- curl -sSL https://github.com/cocogitto/cocogitto/releases/latest/download/cocogitto-6.5.0-x86_64-unknown-linux-musl.tar.gz | tar xz
- mv cog /usr/local/bin/
- cog --version
# Configure Git
- git config --global user.name "woodpecker-ci[bot]"
- git config --global user.email "woodpecker-ci[bot]@noreply.local"
- git config --global --add safe.directory "$CI_WORKSPACE"
# Fetch full history (Woodpecker does shallow clone by default)
- git fetch --unshallow --tags || git fetch --tags
# Check if there are commits to bump
- |
if cog bump --auto --dry-run 2>&1 | grep -qE "(No conventional commits|already on)"; then
echo "No version bump needed"
exit 0
fi
# Bump version
- cog bump --auto
# Push changes and tags using PAT
- git remote set-url origin "https://x-access-token:$GITHUB_TOKEN@github.com/${CI_REPO}.git"
- git push origin HEAD:main
- git push origin --tags
secrets:
- GITHUB_TOKEN