mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-29 00:59:07 -05:00
feat(workflow): automate README badge version updates
- Add automatic README.md badge update to publish workflow - Update workflow to handle 6 files instead of 5 - Sync README badge to match current version (0.1.4) This ensures version badges stay in sync across all releases without manual intervention.
This commit is contained in:
18
.github/workflows/tinytorch-publish-live.yml
vendored
18
.github/workflows/tinytorch-publish-live.yml
vendored
@@ -17,12 +17,13 @@ name: 🔥 TinyTorch Publish (Live)
|
||||
# └─ Run tinytorch-ci.yml tests
|
||||
#
|
||||
# 3. update-version (if preflight passes)
|
||||
# └─ Bump version in 5 files on dev branch:
|
||||
# └─ Bump version in 6 files on dev branch:
|
||||
# - tinytorch/__init__.py
|
||||
# - pyproject.toml
|
||||
# - site/_static/version-badge.js
|
||||
# - site/extra/install.sh
|
||||
# - site/_static/announcement.json
|
||||
# - README.md
|
||||
#
|
||||
# 4. sync-from-dev
|
||||
# └─ Merge dev → main
|
||||
@@ -253,12 +254,25 @@ jobs:
|
||||
echo "✅ announcement.json updated"
|
||||
cat tinytorch/site/_static/announcement.json
|
||||
|
||||
- name: 📝 Update README badge
|
||||
run: |
|
||||
echo "📝 Updating version badge in tinytorch/README.md..."
|
||||
|
||||
VERSION_NUM="${{ needs.validate-inputs.outputs.new_version }}"
|
||||
VERSION_NUM=${VERSION_NUM#tinytorch-v}
|
||||
|
||||
# Update version badge in README.md
|
||||
sed -i "s/version-[0-9.]*-D4740C/version-$VERSION_NUM-D4740C/" tinytorch/README.md
|
||||
|
||||
echo "✅ README.md badge updated"
|
||||
grep "version-" tinytorch/README.md | head -1
|
||||
|
||||
- name: 💾 Commit version update
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add tinytorch/tinytorch/__init__.py tinytorch/pyproject.toml tinytorch/site/_static/version-badge.js tinytorch/site/extra/install.sh tinytorch/site/_static/announcement.json
|
||||
git add tinytorch/tinytorch/__init__.py tinytorch/pyproject.toml tinytorch/site/_static/version-badge.js tinytorch/site/extra/install.sh tinytorch/site/_static/announcement.json tinytorch/README.md
|
||||
git commit -m "chore(tinytorch): bump version to ${{ needs.validate-inputs.outputs.new_version }}" || echo "No changes to commit"
|
||||
git push origin dev
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
### Build Your Own ML Framework From Scratch
|
||||
|
||||
[](https://github.com/harvard-edge/cs249r_book/releases?q=tinytorch)
|
||||
[](https://github.com/harvard-edge/cs249r_book/releases?q=tinytorch)
|
||||
[](https://github.com/harvard-edge/cs249r_book/discussions/1076)
|
||||
[](https://mlsysbook.ai/tinytorch)
|
||||
[](https://python.org)
|
||||
|
||||
Reference in New Issue
Block a user