chore: bootstrap Claude setup
Add root CLAUDE.md, docs/architecture.md, LESSONS.md, .env.example, VERSION, .claude/settings.json hooks (syntax/JSON checks since no linter/tests exist yet), and CI/version-bump GitHub workflows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa24c77bc8
commit
980f9ffe17
11 files changed
+255
No files matched your search
@@ -0,0 +1,36 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [development]
|
||||
push:
|
||||
branches: [development, main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
# No linter/formatter is configured for this project yet (no package.json).
|
||||
# This runs the same quick checks as the local Stop hook: JS syntax check
|
||||
# and JSON validation on every tracked file.
|
||||
- name: Syntax-check JS files
|
||||
run: |
|
||||
status=0
|
||||
while IFS= read -r -d '' f; do
|
||||
node --check "$f" || status=1
|
||||
done < <(git ls-files -z -- '*.js')
|
||||
exit $status
|
||||
|
||||
- name: Validate JSON files
|
||||
run: |
|
||||
status=0
|
||||
while IFS= read -r -d '' f; do
|
||||
node -e "JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'))" "$f" || status=1
|
||||
done < <(git ls-files -z -- '*.json')
|
||||
exit $status
|
||||
@@ -0,0 +1,65 @@
|
||||
name: Version bump
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [development, main]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
# Never trigger on our own bump commits.
|
||||
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 identity
|
||||
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
|
||||
read -r major minor patch < <(tr '.' ' ' < VERSION)
|
||||
|
||||
if [ "${GITHUB_REF_NAME}" = "development" ]; then
|
||||
patch=$((patch + 1))
|
||||
else
|
||||
# main: a merge commit that brings in development's tip is the
|
||||
# approved development -> main promotion (MINOR bump); anything
|
||||
# else pushed directly to main is a hotfix (PATCH bump).
|
||||
if git log -1 --pretty=%P | grep -qE '.+ .+' && \
|
||||
git merge-base --is-ancestor HEAD^2 origin/development 2>/dev/null; then
|
||||
minor=$((minor + 1))
|
||||
patch=0
|
||||
else
|
||||
patch=$((patch + 1))
|
||||
fi
|
||||
fi
|
||||
|
||||
new_version="${major}.${minor}.${patch}"
|
||||
echo "$new_version" > VERSION
|
||||
echo "new_version=$new_version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Commit and push version bump
|
||||
run: |
|
||||
git add VERSION
|
||||
git commit -m "chore(release): v${{ steps.bump.outputs.new_version }} [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-edit origin/main
|
||||
git push origin development
|
||||
Reference in new issue
Block a user