mirror of
https://github.com/Dasemu/x-space-downloader.git
synced 2026-11-27 07:46:25 +00:00
chore: bootstrap Claude setup
Add LESSONS.md, .env.example, a Stop hook running the unit test suite, and a version-bump CI workflow for development/main pushes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5b38cd1f0d
commit
efbc9d8320
5 files changed
+91
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
2
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"Stop": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "cd \"$CLAUDE_PROJECT_DIR\" && pytest -m \"not integration\" -q"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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=
|
||||||
@@ -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
|
||||||
@@ -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)
|
||||||
Reference in new issue
Block a user