Skip to content

Commit 535a384

Browse files
authored
MAINT: Phase 1 - Add HTML archives to GitHub release assets (#659)
Implements Phase 1: HTML archive backup on releases. ## Changes This commit adds steps to the publish.yml workflow to create and upload HTML archives as GitHub release assets: 1. Create HTML archive - Compresses _build/html/ into a .tar.gz archive after the HTML build 2. Generate checksum - Creates SHA256 hash for integrity verification (html-checksum.txt) 3. Create manifest - Generates metadata file with build information (html-manifest.json) 4. Upload to release - Attaches all three files to the GitHub release using softprops/action-gh-release@v1 ## Release Assets Created Each publish-* tag will now include: • 📦 lecture-python-intro-html-{tag}.tar.gz - Full HTML site archive • 🔐 html-checksum.txt - SHA256 verification file • 📋 html-manifest.json - Build metadata (tag, commit, timestamp, size, file count) ## Key Features • ✅ Does not modify _build/html/ directory (gh-pages deployment unaffected) • ✅ Preserves existing release notes (no body override) • ✅ Automatic tag detection from workflow context • ✅ Creates safety net before Phase 2 (gh-pages history cleanup)
1 parent 707faae commit 535a384

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,32 @@ jobs:
7272
run: |
7373
rm -r _build/.doctrees
7474
jb build lectures --path-output ./
75+
# Create HTML archive for release assets
76+
- name: Create HTML archive
77+
shell: bash -l {0}
78+
run: |
79+
tar -czf lecture-python-intro-html-${{ github.ref_name }}.tar.gz -C _build/html .
80+
sha256sum lecture-python-intro-html-${{ github.ref_name }}.tar.gz > html-checksum.txt
81+
82+
# Create metadata manifest
83+
cat > html-manifest.json << EOF
84+
{
85+
"tag": "${{ github.ref_name }}",
86+
"commit": "${{ github.sha }}",
87+
"timestamp": "$(date -Iseconds)",
88+
"size_mb": $(du -sm _build/html | cut -f1),
89+
"file_count": $(find _build/html -type f | wc -l)
90+
}
91+
EOF
92+
- name: Upload archives to release
93+
uses: softprops/action-gh-release@v1
94+
with:
95+
files: |
96+
lecture-python-intro-html-${{ github.ref_name }}.tar.gz
97+
html-checksum.txt
98+
html-manifest.json
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75101
- name: Deploy to Netlify
76102
uses: nwtgck/actions-netlify@v3.0
77103
with:

0 commit comments

Comments
 (0)