Skip to content

Commit 7708e8a

Browse files
authored
MAINT: Phase 1 - Add HTML archives to GitHub release assets (#422)
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-programming-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 7555806 commit 7708e8a

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
@@ -75,6 +75,32 @@ jobs:
7575
shell: bash -l {0}
7676
run: |
7777
jb build lectures --path-output ./ -n -W --keep-going
78+
# Create HTML archive for release assets
79+
- name: Create HTML archive
80+
shell: bash -l {0}
81+
run: |
82+
tar -czf lecture-python-programming-html-${{ github.ref_name }}.tar.gz -C _build/html .
83+
sha256sum lecture-python-programming-html-${{ github.ref_name }}.tar.gz > html-checksum.txt
84+
85+
# Create metadata manifest
86+
cat > html-manifest.json << EOF
87+
{
88+
"tag": "${{ github.ref_name }}",
89+
"commit": "${{ github.sha }}",
90+
"timestamp": "$(date -Iseconds)",
91+
"size_mb": $(du -sm _build/html | cut -f1),
92+
"file_count": $(find _build/html -type f | wc -l)
93+
}
94+
EOF
95+
- name: Upload archives to release
96+
uses: softprops/action-gh-release@v1
97+
with:
98+
files: |
99+
lecture-python-programming-html-${{ github.ref_name }}.tar.gz
100+
html-checksum.txt
101+
html-manifest.json
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78104
- name: Deploy website to gh-pages
79105
uses: peaceiris/actions-gh-pages@v4
80106
with:

0 commit comments

Comments
 (0)