commit 93687f7194d6a015fa8f1feb361a0fa9a927b318
parent 5d87cf7af53bb969dced07992940af494ac92dd1
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Sat, 20 Jun 2026 21:44:26 +0530
changelog
Diffstat:
2 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
@@ -72,20 +72,12 @@ jobs:
python md.py
- name: Generate version file
- run: |
- cat > docs/version.md << EOF
- ---
- title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;" class="lucide lucide-history"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/></svg> Version'
- description: 'Current build information.'
- ---
-
- # Build Info
-
- - **Build ID** — \`${{ github.sha }}\`
- - **Triggered by** — ${{ github.actor }}
- - **Branch** — ${{ github.ref_name }}
- - **Build time** — ${{ github.event.head_commit.timestamp }}
- EOF
+ env:
+ GITHUB_SHA: ${{ github.sha }}
+ GITHUB_ACTOR: ${{ github.actor }}
+ GITHUB_REF_NAME: ${{ github.ref_name }}
+ BUILD_TIMESTAMP: ${{ github.event.head_commit.timestamp }}
+ run: python version.py
- name: Setup Node.js
uses: actions/setup-node@v4
diff --git a/version.py b/version.py
@@ -0,0 +1,29 @@
+import os
+from datetime import datetime, timezone
+
+sha = os.environ.get('GITHUB_SHA', 'unknown')
+actor = os.environ.get('GITHUB_ACTOR', 'unknown')
+ref = os.environ.get('GITHUB_REF_NAME', 'unknown')
+timestamp = os.environ.get('BUILD_TIMESTAMP', '')
+
+try:
+ dt = datetime.fromisoformat(timestamp).astimezone(timezone.utc)
+ build_time = dt.strftime('%B %d, %Y at %H:%M UTC')
+except:
+ build_time = timestamp
+
+content = f"""---
+title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;" class="lucide lucide-history"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/></svg> Version'
+description: 'Current build information.'
+---
+
+# Build Info
+
+- **Build ID** — `{sha}`
+- **Triggered by** — [@{actor}](https://github.com/{actor})
+- **Branch** — `{ref}`
+- **Build time** — {build_time}
+"""
+
+with open('docs/version.md', 'w') as f:
+ f.write(content)+
\ No newline at end of file