mirror of
https://github.com/Dasemu/nextcloud-mcp.git
synced 2026-11-26 15:26:08 +00:00
chore: bootstrap Claude setup
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
33bae54e91
commit
53fc8b2865
12 files changed
+237
No files matched your search
@@ -0,0 +1,68 @@
|
||||
name: Version
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [development, main]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
if: ${{ github.actor != 'github-actions[bot]' && !contains(github.event.head_commit.message, '[skip ci]') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Bump version
|
||||
id: bump
|
||||
run: |
|
||||
set -euo pipefail
|
||||
current=$(cat VERSION)
|
||||
IFS='.' read -r major minor patch <<< "$current"
|
||||
|
||||
if [ "${{ github.ref_name }}" = "development" ]; then
|
||||
patch=$((patch + 1))
|
||||
else
|
||||
# main: a MINOR bump only when every commit in this push came from
|
||||
# development (i.e. an approved development -> main PR merge);
|
||||
# anything else pushed straight to main is treated as a hotfix.
|
||||
parents=$(git log -1 --pretty=%P HEAD | wc -w)
|
||||
if [ "${{ github.event_name }}" = "push" ] && [ "$parents" -gt 1 ] && \
|
||||
git log -1 --pretty=%s HEAD | grep -qiE "merge pull request|from .*/development"; then
|
||||
minor=$((minor + 1))
|
||||
patch=0
|
||||
else
|
||||
patch=$((patch + 1))
|
||||
fi
|
||||
fi
|
||||
|
||||
new_version="$major.$minor.$patch"
|
||||
echo "$new_version" > VERSION
|
||||
echo "version=$new_version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Commit and tag
|
||||
run: |
|
||||
git add VERSION
|
||||
git commit -m "chore(release): v${{ steps.bump.outputs.version }} [skip ci]"
|
||||
git push origin HEAD:${{ github.ref_name }}
|
||||
|
||||
- name: Merge main back into development
|
||||
if: ${{ github.ref_name == 'main' }}
|
||||
run: |
|
||||
if git ls-remote --exit-code --heads origin development > /dev/null; then
|
||||
git fetch origin development
|
||||
git checkout development
|
||||
git merge --no-edit origin/main
|
||||
git push origin development
|
||||
else
|
||||
echo "No development branch yet; skipping merge-back."
|
||||
fi
|
||||
Reference in new issue
Block a user