From 8b9f3a594fae44e118d77aeb4f4015d1de91723a Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 30 Oct 2025 13:40:20 +1100 Subject: [PATCH] MAINT: Phase 1 - Add HTML archives to GitHub release assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2a5e2ae7..3570899e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -72,6 +72,32 @@ jobs: run: | rm -r _build/.doctrees jb build lectures --path-output ./ + # Create HTML archive for release assets + - name: Create HTML archive + shell: bash -l {0} + run: | + tar -czf lecture-python-intro-html-${{ github.ref_name }}.tar.gz -C _build/html . + sha256sum lecture-python-intro-html-${{ github.ref_name }}.tar.gz > html-checksum.txt + + # Create metadata manifest + cat > html-manifest.json << EOF + { + "tag": "${{ github.ref_name }}", + "commit": "${{ github.sha }}", + "timestamp": "$(date -Iseconds)", + "size_mb": $(du -sm _build/html | cut -f1), + "file_count": $(find _build/html -type f | wc -l) + } + EOF + - name: Upload archives to release + uses: softprops/action-gh-release@v1 + with: + files: | + lecture-python-intro-html-${{ github.ref_name }}.tar.gz + html-checksum.txt + html-manifest.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to Netlify uses: nwtgck/actions-netlify@v3.0 with: