Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,106 @@ jobs:
webbrowser_version: ${{ inputs.webbrowser_version || github.event.inputs.webbrowser_version }}
package_format: ${{ inputs.package_format || github.event.inputs.package_format }}
development_build: ${{ inputs.development_build || github.event.inputs.development_build || false }}

summary:
name: "📊 Build Summary"
needs: [windows, macos-x64, macos-arm64, linux-x64, linux-arm64]
if: always()
runs-on: ubuntu-latest
steps:
- name: Download all build summaries
uses: actions/download-artifact@v4
with:
pattern: "*"
path: artifacts
continue-on-error: true

- name: Generate comprehensive summary
shell: bash
run: |
echo "# 🚀 Ultralight WebBrowser - Multi-Platform Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Build Version:** ${{ inputs.webbrowser_version || github.event.inputs.webbrowser_version || 'dev' }}" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Trigger:** ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
echo "**Run ID:** ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Job status table
echo "## 📋 Build Status" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| 🪟 Windows x64 | ${{ needs.windows.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| 🍎 macOS x64 | ${{ needs.macos-x64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| 🍎 macOS ARM64 | ${{ needs.macos-arm64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| 🐧 Linux x64 | ${{ needs.linux-x64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| 🐧 Linux ARM64 | ${{ needs.linux-arm64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# List all artifacts
echo "## 📦 Generated Artifacts" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ -d "artifacts" ]; then
find artifacts -type f \( -name "*.zip" -o -name "*.exe" -o -name "*.tar.gz" -o -name "*.deb" -o -name "*.rpm" -o -name "*.dmg" \) | while read file; do
size=$(du -h "$file" | cut -f1)
filename=$(basename "$file")
echo "- 📄 \`$filename\` ($size)" >> $GITHUB_STEP_SUMMARY
done
else
echo "⚠️ No artifacts directory found" >> $GITHUB_STEP_SUMMARY
fi

echo "" >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Include individual platform summaries if available
echo "## 📝 Platform Details" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

for summary in artifacts/*/BUILD-SUMMARY.md; do
if [ -f "$summary" ]; then
platform=$(dirname "$summary" | xargs basename)
echo "### $platform" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "<details>" >> $GITHUB_STEP_SUMMARY
echo "<summary>View details</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "$summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
fi
done

echo "---" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**🎉 Build completed!**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "*For more information, visit the [GitHub Actions run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})*" >> $GITHUB_STEP_SUMMARY

- name: Check overall build status
shell: bash
run: |
echo "Checking build results..."
if [[ "${{ needs.windows.result }}" != "success" ]] || \
[[ "${{ needs.macos-x64.result }}" != "success" ]] || \
[[ "${{ needs.macos-arm64.result }}" != "success" ]] || \
[[ "${{ needs.linux-x64.result }}" != "success" ]] || \
[[ "${{ needs.linux-arm64.result }}" != "success" ]]; then
echo "⚠️ One or more builds failed or were skipped"
echo "Windows: ${{ needs.windows.result }}"
echo "macOS x64: ${{ needs.macos-x64.result }}"
echo "macOS ARM64: ${{ needs.macos-arm64.result }}"
echo "Linux x64: ${{ needs.linux-x64.result }}"
echo "Linux ARM64: ${{ needs.linux-arm64.result }}"
exit 1
else
echo "✅ All builds succeeded!"
fi
158 changes: 154 additions & 4 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,56 @@ jobs:
with:
submodules: recursive

- name: 1.5 Setup CMake Build Cache
uses: actions/cache@v4
with:
path: |
build
!build/CMakeFiles
!build/Testing
!build/_CPack_Packages
!build/**/*.tar.gz
!build/**/*.deb
!build/**/*.rpm
!build/**/*.7z
key: ${{ runner.os }}-cmake-${{ hashFiles('CMakeLists.txt', 'cmake/**') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cmake-${{ hashFiles('CMakeLists.txt', 'cmake/**') }}-
${{ runner.os }}-cmake-

- name: 1.6 Setup SDK Cache
uses: actions/cache@v4
with:
path: |
libs/Ultralight
ultralight-sdk-*.7z
key: ${{ runner.os }}-sdk-${{ env.ULTRALIGHT_VERSION || 'latest' }}
restore-keys: |
${{ runner.os }}-sdk-

- name: 1.7 Setup APT Cache
uses: actions/cache@v4
with:
path: |
/var/cache/apt/archives
/var/lib/apt/lists
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/build-linux.yml') }}
restore-keys: |
${{ runner.os }}-apt-

- name: 1.8 Setup Compiler Cache (ccache)
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-

- name: 1.9 Configure Compiler Cache Environment
shell: bash
run: |
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV

- name: 2. Detect ULTRALIGHT_SDK_URL from repo base-sdk branch (Linux)
id: detect_url
shell: bash
Expand Down Expand Up @@ -260,6 +310,24 @@ jobs:
- name: 6. Configure CMake
if: steps.prep_sdk.outputs.present == 'true'
run: |
# Skip reconfiguration if CMakeCache.txt exists and is valid
if [ -f "build/CMakeCache.txt" ]; then
echo "CMake cache found, checking if reconfiguration needed..."
cacheValid=true

# Check if SDK root changed
cachedSdkRoot=$(grep "ULTRALIGHT_SDK_ROOT:.*=" build/CMakeCache.txt | sed 's/.*=//' || true)
if [ "$cachedSdkRoot" != "$ULTRALIGHT_SDK_ROOT" ]; then
echo "SDK root changed, reconfiguration needed"
cacheValid=false
fi

if [ "$cacheValid" = "true" ]; then
echo "✅ CMake cache is valid, skipping reconfiguration (saves ~30-60 seconds)"
exit 0
fi
fi

cmake --version
echo "Configuring with ULTRALIGHT_SDK_ROOT=$ULTRALIGHT_SDK_ROOT"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DULTRALIGHT_SDK_ROOT="$ULTRALIGHT_SDK_ROOT" -DBUILD_TESTING=OFF -DAUTO_INSTALL_CURL=ON -DWEBBROWSER_VERSION="$WEBBROWSER_VERSION"
Expand Down Expand Up @@ -321,7 +389,64 @@ jobs:
echo "Listing resources:"
ls -la "$src"/assets/resources 2>/dev/null || true

- name: 8. Package with CPack (Linux)
- name: 8. Generate Build Summary Report
if: steps.prep_sdk.outputs.present == 'true'
shell: bash
run: |
set -euo pipefail
echo "🚀 Generating comprehensive build summary..."

# Get SDK version
sdkVersion="${ULTRALIGHT_VERSION:-Unknown}"
if [ -f "build/ultralight_sdk_version.txt" ]; then
sdkVersion=$(cat "build/ultralight_sdk_version.txt" | tr -d '[:space:]')
fi

# Make script executable
chmod +x scripts/generate-build-summary.sh

# Run the build summary script
bash scripts/generate-build-summary.sh \
"build" \
"Linux" \
"x64" \
"${WEBBROWSER_VERSION}" \
"${{ github.sha }}" \
"$sdkVersion" \
"BUILD-SUMMARY.md"

# Create JSON metadata file
cat > build/BUILD-METADATA.json << EOF
{
"platform": "Linux",
"architecture": "x64",
"version": "${WEBBROWSER_VERSION}",
"commit": "${{ github.sha }}",
"commitShort": "$(echo '${{ github.sha }}' | cut -c1-7)",
"buildDate": "$(date -u +"%Y-%m-%d %H:%M:%S UTC")",
"sdkVersion": "$sdkVersion",
"repository": "${{ github.repository }}",
"runId": "${{ github.run_id }}",
"runNumber": "${{ github.run_number }}"
}
EOF

echo "✅ Build summary and metadata generated successfully"

- name: 8.1 Display Build Summary
if: steps.prep_sdk.outputs.present == 'true'
shell: bash
run: |
echo "📊 Build Summary:"
echo "═══════════════════════════════════════════════════════════"
if [ -f "build/BUILD-SUMMARY.md" ]; then
cat "build/BUILD-SUMMARY.md"
else
echo "⚠️ BUILD-SUMMARY.md not found"
fi
echo "═══════════════════════════════════════════════════════════"

- name: 8.2 Package with CPack (Linux)
if: steps.prep_sdk.outputs.present == 'true'
shell: bash
run: |
Expand Down Expand Up @@ -375,15 +500,15 @@ jobs:
fi
done

- name: 8.2 List package outputs
- name: 8.4 List package outputs
if: steps.prep_sdk.outputs.present == 'true'
shell: bash
run: |
set -euo pipefail
echo "Final packages in build directory:"
ls -lh "${{ github.workspace }}/build"/Ultralight-WebBrowser-* || true

- name: 8.3 Upload Final Packages
- name: 8.5 Upload Final Packages
if: steps.prep_sdk.outputs.present == 'true'
uses: actions/upload-artifact@v4
with:
Expand All @@ -392,13 +517,38 @@ jobs:
${{ github.workspace }}/build/Ultralight-WebBrowser-*-Linux-x64.tar.gz
${{ github.workspace }}/build/Ultralight-WebBrowser-*-Linux-x64.deb
${{ github.workspace }}/build/Ultralight-WebBrowser-*-Linux-x64.rpm
${{ github.workspace }}/build/BUILD-SUMMARY.md
${{ github.workspace }}/build/BUILD-METADATA.json
if-no-files-found: warn

- name: 8.4 Upload Intermediate Packages (Development Only)
- name: 8.6 Upload Intermediate Packages (Development Only)
if: steps.prep_sdk.outputs.present == 'true' && env.DEVELOPMENT_BUILD == 'true'
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: Ultralight-WebBrowser-${{ env.WEBBROWSER_VERSION }}-Linux-x64-Intermediate
path: ${{ github.workspace }}/build/_CPack_Packages/
if-no-files-found: warn

- name: 9. Job Summary
if: always()
shell: bash
run: |
echo "📋 Adding build summary to GitHub Actions job summary..."
if [ -f "build/BUILD-SUMMARY.md" ]; then
cat "build/BUILD-SUMMARY.md" >> $GITHUB_STEP_SUMMARY
echo "✅ Summary added to job output"
else
echo "⚠️ BUILD-SUMMARY.md not found, skipping job summary"
fi

# Show cache statistics
echo ""
echo "📊 Cache Statistics:"
echo "═══════════════════════════════════════════════════════════"
if command -v ccache &> /dev/null; then
ccache --show-stats
else
echo "ccache not found in PATH"
fi
echo "═══════════════════════════════════════════════════════════"
Loading
Loading