chore: bootstrap Claude setup
Add root CLAUDE.md, docs/, LESSONS.md, .env.example, .claude/settings.json hooks (syntax-check on edit and on stop), and CI workflows (lint via node --check, and a VERSION-based semver bump) for this plain-JS, no-build Chrome extension. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
733097a002
commit
7285c82fb7
9 files changed
+199
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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 or test suite is configured for this plain-JS browser extension
|
||||
# (no package.json/bundler). This runs a syntax check on every JS file.
|
||||
- name: Syntax check (node --check)
|
||||
run: |
|
||||
find . -name "*.js" -not -path "./.git/*" -print0 | xargs -0 -n1 node --check
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Version bump
|
||||
|
||||
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
|
||||
# push to main: MINOR bump only when this commit is already part of
|
||||
# development's history (i.e. an approved development -> main merge
|
||||
# PR); otherwise treat it as a direct hotfix push (PATCH bump).
|
||||
if git fetch origin development >/dev/null 2>&1 && \
|
||||
git merge-base --is-ancestor "$(git rev-parse HEAD)" origin/development; 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 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: |
|
||||
if git ls-remote --exit-code --heads origin development >/dev/null 2>&1; then
|
||||
git fetch origin development
|
||||
git checkout -B development origin/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