1818 uses : actions/checkout@v4
1919 with :
2020 token : ${{ secrets.GITHUB_TOKEN }}
21+ fetch-depth : 0
2122
2223 - name : Setup Python
2324 uses : actions/setup-python@v4
3031 echo "pdoc3 version:"
3132 pdoc --version
3233
34+ - name : Increment version
35+ run : |
36+ # Create .version file if it doesn't exist
37+ if [ ! -f .version ]; then
38+ echo "0.1" > .version
39+ echo "Created .version file with initial version 0.1"
40+ fi
41+
42+ # Read current version
43+ current_version=$(cat .version)
44+ echo "Current version: $current_version"
45+
46+ # Increment version (major.minor format)
47+ IFS='.' read -r major minor <<< "$current_version"
48+ new_minor=$((minor + 1))
49+ new_version="${major}.${new_minor}"
50+
51+ echo "New version: $new_version"
52+
53+ # Save new version
54+ echo "$new_version" > .version
55+
56+ # Update setup.py
57+ sed -i "s/version=\"[^\"]*\"/version=\"$new_version\"/" setup.py
58+
59+ echo "=== Updated files ==="
60+ echo "Version file:"
61+ cat .version
62+ echo "setup.py:"
63+ grep 'version=' setup.py
64+
3365 - name : Check vicutils directory
3466 run : |
3567 echo "=== Contents of vicutils directory ==="
@@ -63,11 +95,16 @@ jobs:
6395 run : |
6496 git config --local user.name "Vic-Nas"
6597 git config --local user.email "github-actions@github.com"
98+
99+ # Add all changes
100+ git add .version setup.py
66101 git add vicutils/*.html || echo "No HTML files to add"
102+
67103 if git diff --staged --quiet; then
68104 echo "No changes to commit"
69105 else
70- echo "Committing changes"
71- git commit -m "Auto-generate VicUtils documentation [skip ci]"
106+ new_version=$(cat .version)
107+ echo "Committing changes for version $new_version"
108+ git commit -m "Auto-generate docs and bump version to $new_version [skip ci]"
72109 git push
73- fi
110+ fi
0 commit comments