diff --git a/.claude/bootstrap-version b/.claude/bootstrap-version new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/.claude/bootstrap-version @@ -0,0 +1 @@ +2 diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..d3253f6 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,14 @@ +{ + "hooks": { + "Stop": [ + { + "hooks": [ + { + "type": "command", + "command": "cd \"$CLAUDE_PROJECT_DIR\" && pytest -m \"not integration\" -q" + } + ] + } + ] + } +} diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2119162 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# X (Twitter) web GraphQL bearer token, used to fetch Space metadata/timeline. +X_BEARER_TOKEN= + +# Optional: override the AudioSpaceById GraphQL query id if X rotates it. +X_AUDIO_SPACE_QUERY_ID= diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 0000000..e8fceb3 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,66 @@ +name: Version bump + +on: + push: + branches: [development, main] + +permissions: + contents: write + +jobs: + bump: + if: github.actor != 'github-actions[bot]' + 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: Determine bump type + id: bump + run: | + if [ "${{ github.ref_name }}" = "development" ]; then + echo "type=patch" >> "$GITHUB_OUTPUT" + else + # On main: minor bump if this push merged development, otherwise a hotfix patch bump. + if git merge-base --is-ancestor origin/development HEAD 2>/dev/null; then + echo "type=minor" >> "$GITHUB_OUTPUT" + else + echo "type=patch" >> "$GITHUB_OUTPUT" + fi + fi + + - name: Bump version in pyproject.toml + id: version + run: | + current=$(grep -m1 '^version = ' pyproject.toml | sed -E 's/version = "(.*)"/\1/') + IFS='.' read -r major minor patch <<< "$current" + if [ "${{ steps.bump.outputs.type }}" = "minor" ]; then + minor=$((minor + 1)) + patch=0 + else + patch=$((patch + 1)) + fi + new="$major.$minor.$patch" + sed -i -E "0,/^version = \".*\"/s//version = \"$new\"/" pyproject.toml + echo "new=$new" >> "$GITHUB_OUTPUT" + + - name: Commit version bump + run: | + git add pyproject.toml + git commit -m "chore(release): v${{ steps.version.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-edit origin/main + git push origin development diff --git a/LESSONS.md b/LESSONS.md new file mode 100644 index 0000000..a7b7ebd --- /dev/null +++ b/LESSONS.md @@ -0,0 +1,5 @@ +# LESSONS.md + +Recurring mistakes in this repo and how to avoid them. + +- (none recorded yet — add entries here as mistakes repeat)