mirror of
https://github.com/Dasemu/chatgpt-imagegen-mcp.git
synced 2026-11-26 15:26:21 +00:00
Add .claude/settings.json hooks (typecheck on edited .ts files, guard on package-lock.json edits, Stop runs typecheck + test), CI workflow (typecheck + test on PRs/pushes to development/main), and a version bump workflow keyed off package.json. Restructure CLAUDE.md to match the standard section order (Overview, Commands, Architecture, Conventions, Workflow quirks, Deployment, Gotchas); docs/, LESSONS.md and .env.example were already present and in sync. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
57 lines
1.9 KiB
YAML
57 lines
1.9 KiB
YAML
name: Version bump
|
|
|
|
# MAJOR.MINOR.PATCH lives in package.json.
|
|
# push to development -> PATCH + 1
|
|
# push to main merging development (PR) -> MINOR + 1, PATCH = 0
|
|
# any other push to main (hotfix) -> PATCH + 1, then main is merged back into development
|
|
|
|
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
|
|
|
|
- name: Bump version
|
|
id: bump
|
|
run: |
|
|
set -euo pipefail
|
|
branch="${GITHUB_REF_NAME}"
|
|
cur=$(node -p "require('./package.json').version")
|
|
IFS=. read -r major minor patch <<< "$cur"
|
|
kind=patch
|
|
if [ "$branch" = main ]; then
|
|
parents=$(git rev-list --parents -n1 HEAD | wc -w)
|
|
if [ "$parents" -eq 3 ] && git merge-base --is-ancestor HEAD^2 origin/development 2>/dev/null; then
|
|
kind=minor
|
|
fi
|
|
fi
|
|
if [ "$kind" = minor ]; then minor=$((minor + 1)); patch=0; else patch=$((patch + 1)); fi
|
|
new="$major.$minor.$patch"
|
|
npm pkg set version="$new"
|
|
echo "new=$new" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Commit and push
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git commit -am "chore(release): v${{ steps.bump.outputs.new }} [skip ci]"
|
|
git push origin "HEAD:${GITHUB_REF_NAME}"
|
|
|
|
- name: Merge main back into development
|
|
if: github.ref_name == 'main'
|
|
run: |
|
|
git fetch origin development
|
|
git checkout development
|
|
git merge --no-ff origin/main -m "chore: merge main into development [skip ci]"
|
|
git push origin development
|