Fix small release issues #518
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/rust.yml | |
| # | |
| # Two modes: | |
| # | |
| # - ci: Runs on push/PR, builds everything, runs tests, creates artifacts | |
| # - deploy: Manual trigger, downloads CI artifacts, deploys to GitHub Pages | |
| name: build | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+*' | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| run_mode: | |
| description: 'Select the workflow to run' | |
| type: choice | |
| options: | |
| - ci | |
| - deploy | |
| required: true | |
| default: 'ci' | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| # ============================================================================= | |
| # CI Jobs - Run on push, PR, or manual 'ci' mode | |
| # ============================================================================= | |
| lint_and_check: | |
| name: Lint & Static Checks | |
| if: github.event_name != 'workflow_dispatch' || github.event.inputs.run_mode == 'ci' || github.event.inputs.run_mode == 'deploy' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.87.0 | |
| - name: Run autofix and normalize | |
| run: | | |
| cargo run -r -p azul-doc autofix | |
| cargo run -r -p azul-doc autofix explain | |
| cargo run -r -p azul-doc patch safe target/autofix/patches | |
| cargo run -r -p azul-doc patch target/autofix/patches | |
| cargo run -r -p azul-doc normalize | |
| - name: Check for uncommitted changes after autofix | |
| run: | | |
| if ! git diff --quiet; then | |
| echo "There are uncommitted content changes after running autofix:" | |
| git diff --stat | |
| git diff | |
| exit 1 | |
| elif [[ -n $(git status --porcelain) ]]; then | |
| echo "Files touched but no content changes - resetting:" | |
| git checkout -- . | |
| echo "Reset complete, continuing..." | |
| else | |
| echo "No uncommitted changes after autofix." | |
| fi | |
| - name: Generate DLL API bindings and run tests | |
| run: | | |
| cargo run -r -p azul-doc codegen all | |
| cd dll && cargo test | |
| - name: Check crates | |
| run: | | |
| cargo check -p azul-css | |
| cargo check -p azul-core | |
| cargo check -p azul-layout | |
| cargo check -p azul-dll --no-default-features --features "link-static,logging,ico,tga,hdr,webp,pnm,gif,png,tiff,bmp,a11y" | |
| test_heavy: | |
| name: Run Heavy Tests (Miri + Reftests) | |
| if: github.event_name != 'workflow_dispatch' || github.event.inputs.run_mode == 'ci' || github.event.inputs.run_mode == 'deploy' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.87.0 | |
| - name: Install Miri | |
| run: | | |
| rustup toolchain install nightly --component miri | |
| cargo +nightly miri setup | |
| - name: Run Miri tests | |
| run: cargo +nightly miri test --lib -p azul-core | |
| - name: Generate DLL API bindings | |
| run: cargo run -r -p azul-doc codegen all | |
| - name: Setup Chrome | |
| uses: browser-actions/setup-chrome@v1 | |
| - name: Cache Chrome reference images | |
| uses: actions/cache@v4 | |
| with: | |
| path: doc/target/reftest/reftest_img/*_chrome.webp | |
| key: reftest-chrome-images-${{ hashFiles('doc/working/*.xhtml') }} | |
| restore-keys: reftest-chrome-images- | |
| - name: Run reftests | |
| run: cargo run -r -p azul-doc reftest | |
| - name: Upload reftest results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: reftest-results | |
| path: | | |
| doc/target/reftest/index.html | |
| doc/target/reftest/results.json | |
| doc/target/reftest/reftest_img/ | |
| retention-days: 30 | |
| if-no-files-found: warn | |
| ffi_safety_tests: | |
| name: FFI Safety Tests (${{ matrix.os }}) | |
| if: github.event_name != 'workflow_dispatch' || github.event.inputs.run_mode == 'ci' || github.event.inputs.run_mode == 'deploy' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| timeout_cmd: timeout | |
| - os: macos-14 | |
| timeout_cmd: gtimeout | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.87.0 | |
| - name: Install dependencies (Ubuntu) | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: sudo apt-get update && sudo apt-get install -y clang lldb | |
| - name: Install dependencies (macOS) | |
| if: matrix.os == 'macos-14' | |
| run: brew install coreutils | |
| - name: Install Miri | |
| run: | | |
| rustup toolchain install nightly --component miri | |
| cargo +nightly miri setup | |
| - name: Generate DLL API bindings | |
| run: cargo run -r -p azul-doc codegen all | |
| - name: Build azul-dll (debug) | |
| run: cargo build -p azul-dll --features build-dll | |
| - name: Compile C hello-world with ASan | |
| run: | | |
| cp target/codegen/v2/azul.h examples/c/ | |
| cd examples/c | |
| clang -g -O0 -fsanitize=address -I. hello-world.c -L../../target/debug -lazul -o hello-world-asan | |
| - name: Run C hello-world with ASan | |
| working-directory: examples/c | |
| env: | |
| LD_LIBRARY_PATH: ${{ github.workspace }}/target/debug | |
| DYLD_LIBRARY_PATH: ${{ github.workspace }}/target/debug | |
| ASAN_OPTIONS: detect_leaks=0,abort_on_error=1 | |
| AZUL_EXIT_SUCCESS_AFTER_FRAME_RENDER: "1" | |
| run: ${{ matrix.timeout_cmd }} 30 ./hello-world-asan || [ $? -eq 124 ] | |
| - name: Run Miri on azul-dll | |
| run: cargo +nightly miri test --lib -p azul-dll -- --nocapture | |
| build_binaries: | |
| name: Build Binaries (${{ matrix.os }}) | |
| if: github.event_name != 'workflow_dispatch' || github.event.inputs.run_mode == 'ci' || github.event.inputs.run_mode == 'deploy' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| artifact_name: azul-linux-amd64 | |
| artifact_path: | | |
| target/release/libazul.so | |
| target/release/libazul.a | |
| target/release/azul.so | |
| - os: macos-14 | |
| artifact_name: azul-macos-amd64 | |
| artifact_path: | | |
| target/release/libazul.dylib | |
| target/release/libazul.a | |
| target/release/azul.so | |
| - os: windows-2022 | |
| artifact_name: azul-windows-amd64 | |
| artifact_path: | | |
| target/release/azul.dll | |
| target/release/azul.lib | |
| target/release/azul.dll.lib | |
| target/release/azul.pyd | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.87.0 | |
| - name: Install clang (Linux) | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: sudo apt-get update && sudo apt-get install -y clang | |
| - name: Install coreutils (macOS) | |
| if: matrix.os == 'macos-14' | |
| run: brew install coreutils | |
| - name: Generate DLL API bindings | |
| run: cargo run -r -p azul-doc codegen all | |
| - name: Validate C header syntax (Linux) | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: | | |
| cd target/codegen/v2 | |
| clang -fsyntax-only -std=c99 -x c azul.h | |
| echo "C header (C99) compiles successfully" | |
| - name: Validate C++ headers (Linux) | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: | | |
| cd target/codegen/v2 | |
| clang++ -std=c++03 -fsyntax-only -I. azul03.hpp && echo "C++03 ✓" | |
| clang++ -std=c++11 -fsyntax-only -I. azul11.hpp && echo "C++11 ✓" | |
| clang++ -std=c++14 -fsyntax-only -I. azul14.hpp && echo "C++14 ✓" | |
| clang++ -std=c++17 -fsyntax-only -I. azul17.hpp && echo "C++17 ✓" | |
| clang++ -std=c++20 -fsyntax-only -I. azul20.hpp && echo "C++20 ✓" | |
| clang++ -std=c++2b -fsyntax-only -I. azul23.hpp && echo "C++23 ✓" | |
| - name: Compile C examples (syntax check) | |
| if: matrix.os != 'windows-2022' | |
| shell: bash | |
| run: | | |
| cd examples/c | |
| for example in *.c; do | |
| [ -f "$example" ] && clang -fsyntax-only -std=c99 -I../../target/codegen/v2 "$example" && echo "✓ $example" | |
| done | |
| - name: Compile C++ examples (syntax check) | |
| if: matrix.os != 'windows-2022' | |
| shell: bash | |
| run: | | |
| for std in cpp03:c++03 cpp11:c++11 cpp14:c++14 cpp17:c++17 cpp23:c++2b; do | |
| dir="${std%:*}" | |
| flag="${std#*:}" | |
| if [ -d "examples/cpp/$dir" ]; then | |
| cd "examples/cpp/$dir" | |
| for example in *.cpp; do | |
| [ -f "$example" ] && clang++ -fsyntax-only -std=$flag -I../../../target/codegen/v2 "$example" && echo "✓ $dir/$example" | |
| done | |
| cd ../../.. | |
| fi | |
| done | |
| - name: Build DLL (for C/C++ examples) | |
| run: cargo build --release -p azul-dll --features="build-dll" | |
| - name: Build Rust examples | |
| run: cargo check --verbose --examples --all-features | |
| - name: Take screenshots (Linux) | |
| if: matrix.os == 'ubuntu-22.04' | |
| continue-on-error: true | |
| run: | | |
| chmod +x scripts/screenshot.sh | |
| xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" ./scripts/screenshot.sh || echo "Screenshots failed" | |
| - name: Take screenshots (macOS) | |
| if: matrix.os == 'macos-14' | |
| continue-on-error: true | |
| run: | | |
| chmod +x scripts/screenshot.sh | |
| ./scripts/screenshot.sh || echo "Screenshots failed" | |
| - name: Take screenshots (Windows) | |
| if: matrix.os == 'windows-2022' | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| chmod +x scripts/screenshot.sh | |
| ./scripts/screenshot.sh || echo "Screenshots failed" | |
| - name: Build Python extension | |
| run: cargo build --release -p azul-dll --lib --features="python-extension" | |
| - name: Rename Python extension (Windows) | |
| if: matrix.os == 'windows-2022' | |
| shell: bash | |
| run: cp target/release/azul.dll target/release/azul.pyd | |
| - name: Rename Python extension (Linux) | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: cp target/release/libazul.so target/release/azul.so | |
| - name: Rename Python extension (macOS) | |
| if: matrix.os == 'macos-14' | |
| run: cp target/release/libazul.dylib target/release/azul.so | |
| - name: Test Python extension import | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.os }}" = "windows-2022" ]; then | |
| export PATH=$PATH:$(pwd)/target/release | |
| python3 -c "import sys; sys.path.insert(0, 'target/release'); import azul; print('Python extension loaded!')" | |
| else | |
| cp target/release/azul.so examples/python/ | |
| cd examples/python && python3 -c "import azul; print('Python extension loaded!')" | |
| fi | |
| - name: Upload Screenshots | |
| uses: actions/upload-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: screenshots-${{ matrix.os }} | |
| path: target/screenshots/*.png | |
| retention-days: 7 | |
| if-no-files-found: ignore | |
| - name: Debug - Tree before upload | |
| shell: bash | |
| run: | | |
| echo "=== target/release ===" | |
| ls -la target/release/ 2>/dev/null | head -30 || echo "Not found" | |
| echo "=== target/codegen/v2 ===" | |
| ls -la target/codegen/v2/ 2>/dev/null | head -20 || echo "Not found" | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_path }} | |
| retention-days: 30 | |
| if-no-files-found: error | |
| - name: Upload Headers (Linux only) | |
| if: matrix.os == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: azul-headers | |
| path: | | |
| target/codegen/v2/azul.h | |
| target/codegen/v2/azul03.hpp | |
| target/codegen/v2/azul11.hpp | |
| target/codegen/v2/azul14.hpp | |
| target/codegen/v2/azul17.hpp | |
| target/codegen/v2/azul20.hpp | |
| target/codegen/v2/azul23.hpp | |
| retention-days: 30 | |
| if-no-files-found: error | |
| build_linux_packages: | |
| name: Build Linux Packages (.deb/.rpm) | |
| if: github.event_name != 'workflow_dispatch' || github.event.inputs.run_mode == 'ci' || github.event.inputs.run_mode == 'deploy' | |
| needs: [build_binaries, build_website_skeleton] | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download Linux binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: azul-linux-amd64 | |
| path: artifacts | |
| - name: Download NFPM config | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nfpm-config | |
| path: nfpm-config | |
| - name: Debug - Tree after download | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y tree nfpm | |
| echo "=== Downloaded artifacts ===" | |
| tree artifacts/ nfpm-config/ 2>/dev/null || ls -laR artifacts/ nfpm-config/ | |
| - name: Prepare package files | |
| run: | | |
| mkdir -p target/packages | |
| find artifacts -name "libazul.so" -exec cp {} target/packages/ \; | |
| find nfpm-config -name "azul.h" -exec cp {} target/packages/ \; | |
| find nfpm-config -name "nfpm.yaml" -exec cp {} target/packages/ \; | |
| cp LICENSE target/packages/ | |
| ls -la target/packages/ | |
| - name: Build .deb and .rpm packages | |
| run: | | |
| cd target/packages | |
| nfpm pkg --packager deb --target . | |
| nfpm pkg --packager rpm --target . | |
| - name: Debug - Tree before upload | |
| run: | | |
| echo "=== target/packages ===" | |
| tree target/packages/ 2>/dev/null || ls -la target/packages/ | |
| - name: Upload .deb package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: azul-linux-amd64-deb | |
| path: target/packages/*.deb | |
| retention-days: 30 | |
| if-no-files-found: error | |
| - name: Upload .rpm package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: azul-linux-amd64-rpm | |
| path: target/packages/*.rpm | |
| retention-days: 30 | |
| if-no-files-found: error | |
| build_website_skeleton: | |
| name: Build Website Skeleton | |
| if: github.event_name != 'workflow_dispatch' || github.event.inputs.run_mode == 'ci' || github.event.inputs.run_mode == 'deploy' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.87.0 | |
| - name: Generate codegen and NFPM config | |
| run: | | |
| cargo run -r -p azul-doc codegen all | |
| cargo run -r -p azul-doc nfpm | |
| - name: Create placeholder binaries | |
| run: | | |
| # Create placeholder files where real binaries will be inserted later | |
| mkdir -p doc/target/deploy/release/1.0.0-alpha1 | |
| touch doc/target/deploy/release/1.0.0-alpha1/libazul.so | |
| touch doc/target/deploy/release/1.0.0-alpha1/libazul.linux.a | |
| touch doc/target/deploy/release/1.0.0-alpha1/azul.cpython.so | |
| touch doc/target/deploy/release/1.0.0-alpha1/libazul.dylib | |
| touch doc/target/deploy/release/1.0.0-alpha1/libazul.macos.a | |
| touch doc/target/deploy/release/1.0.0-alpha1/azul.macos.so | |
| touch doc/target/deploy/release/1.0.0-alpha1/azul.dll | |
| touch doc/target/deploy/release/1.0.0-alpha1/azul.lib | |
| touch doc/target/deploy/release/1.0.0-alpha1/azul.dll.lib | |
| touch doc/target/deploy/release/1.0.0-alpha1/azul.pyd | |
| # Placeholder reftest | |
| mkdir -p doc/target/reftest/reftest_img | |
| echo '[]' > doc/target/reftest/results.json | |
| echo '<html><body>Placeholder</body></html>' > doc/target/reftest/index.html | |
| - name: Build website with placeholders | |
| run: cargo run --manifest-path doc/Cargo.toml --release -- deploy | |
| - name: Debug - Tree before upload | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y tree | |
| tree doc/target/deploy/ 2>/dev/null | head -100 || ls -laR doc/target/deploy/ | head -100 | |
| - name: Upload website skeleton | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: website-skeleton | |
| path: doc/target/deploy/ | |
| retention-days: 30 | |
| if-no-files-found: error | |
| - name: Upload NFPM config and headers | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nfpm-config | |
| path: | | |
| target/packages/nfpm.yaml | |
| target/codegen/v2/azul.h | |
| retention-days: 30 | |
| if-no-files-found: error | |
| # ============================================================================= | |
| # Deploy Job - Only runs on manual 'deploy' mode | |
| # Downloads all artifacts and merges them (NO compilation) | |
| # ============================================================================= | |
| deploy_pages: | |
| name: Deploy to GitHub Pages | |
| if: github.event.inputs.run_mode == 'deploy' | |
| needs: [test_heavy, build_binaries, build_linux_packages, build_website_skeleton] | |
| runs-on: ubuntu-22.04 | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Download website skeleton | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: website-skeleton | |
| path: website | |
| - name: Download Linux binaries | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: azul-linux-amd64 | |
| path: artifacts-linux | |
| - name: Download macOS binaries | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: azul-macos-amd64 | |
| path: artifacts-macos | |
| - name: Download Windows binaries | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: azul-windows-amd64 | |
| path: artifacts-windows | |
| - name: Download .deb package | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: azul-linux-amd64-deb | |
| path: artifacts-deb | |
| - name: Download .rpm package | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: azul-linux-amd64-rpm | |
| path: artifacts-rpm | |
| - name: Download headers | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: azul-headers | |
| path: artifacts-headers | |
| - name: Download reftest results | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: reftest-results | |
| path: artifacts-reftest | |
| - name: Debug - Tree after download | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y tree | |
| echo "=== Website skeleton ===" | |
| tree website/ 2>/dev/null | head -50 || ls -laR website/ | head -50 | |
| echo "" | |
| echo "=== Artifacts ===" | |
| tree artifacts-* 2>/dev/null || ls -laR artifacts-* 2>/dev/null || true | |
| - name: Merge real artifacts into website | |
| run: | | |
| RELEASE_DIR="website/release/1.0.0-alpha1" | |
| mkdir -p "$RELEASE_DIR" | |
| # Replace placeholder binaries with real ones | |
| # Linux | |
| find artifacts-linux -name "libazul.so" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| find artifacts-linux -name "libazul.a" -exec cp {} "$RELEASE_DIR/libazul.linux.a" \; 2>/dev/null || true | |
| find artifacts-linux -name "azul.so" -exec cp {} "$RELEASE_DIR/azul.cpython.so" \; 2>/dev/null || true | |
| # macOS | |
| find artifacts-macos -name "libazul.dylib" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| find artifacts-macos -name "libazul.a" -exec cp {} "$RELEASE_DIR/libazul.macos.a" \; 2>/dev/null || true | |
| find artifacts-macos -name "azul.so" -exec cp {} "$RELEASE_DIR/azul.macos.so" \; 2>/dev/null || true | |
| # Windows | |
| find artifacts-windows -name "azul.dll" ! -name "*.lib" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| find artifacts-windows -name "azul.lib" ! -name "azul.dll.lib" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| find artifacts-windows -name "azul.dll.lib" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| find artifacts-windows -name "azul.pyd" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| # Headers | |
| find artifacts-headers -name "*.h" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| find artifacts-headers -name "*.hpp" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| # Packages | |
| find artifacts-deb -name "*.deb" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| find artifacts-rpm -name "*.rpm" -exec cp {} "$RELEASE_DIR/" \; 2>/dev/null || true | |
| # Replace placeholder reftest with real results | |
| if [ -d artifacts-reftest ]; then | |
| rm -rf website/reftest 2>/dev/null || true | |
| mkdir -p website/reftest | |
| cp -r artifacts-reftest/* website/reftest/ | |
| # Also copy index.html to reftest.html in website root | |
| if [ -f website/reftest/index.html ]; then | |
| cp website/reftest/index.html website/reftest.html | |
| echo " [OK] Created reftest.html from reftest results" | |
| fi | |
| fi | |
| # Update file sizes in release HTML | |
| # The HTML contains "N/A" or placeholder sizes that need to be replaced with real sizes | |
| if [ -d "$RELEASE_DIR" ]; then | |
| echo "Updating file sizes in release HTML..." | |
| for file in "$RELEASE_DIR"/*; do | |
| if [ -f "$file" ]; then | |
| filename=$(basename "$file") | |
| size=$(du -h "$file" | cut -f1) | |
| # Find and update the size in release HTML files | |
| for html in website/release/*.html; do | |
| if [ -f "$html" ]; then | |
| # Replace "filename - N/A" or "filename - not available" with actual size | |
| sed -i "s|${filename} - N/A|${filename} - ${size}|g" "$html" 2>/dev/null || true | |
| sed -i "s|${filename} - not available|${filename} - ${size}|g" "$html" 2>/dev/null || true | |
| fi | |
| done | |
| fi | |
| done | |
| fi | |
| echo "=== Final release artifacts ===" | |
| ls -la "$RELEASE_DIR/" | |
| - name: Debug - Final website tree | |
| run: tree website/ 2>/dev/null | head -100 || ls -laR website/ | head -100 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'website' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |