chore(release): v0.2.0 #32
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
| name: CI | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| "on": | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| include: | |
| - os: macos-latest | |
| platform: darwin | |
| - os: ubuntu-latest | |
| platform: linux | |
| - os: windows-latest | |
| platform: win32 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev pkg-config libxdo-dev xvfb | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build packages | |
| run: bun run build:packages | |
| - name: Build native addon | |
| run: | | |
| cd packages/bunlet-native | |
| cargo build --release | |
| bun run scripts/copy-artifact.js | |
| - name: Type check | |
| run: bun run typecheck | |
| - name: Lint | |
| run: bun run lint | |
| - name: Run tests | |
| if: matrix.os != 'ubuntu-latest' | |
| run: bun test | |
| env: | |
| BUNLET_CLI_ROUNDTRIP: '1' | |
| - name: Run tests (with virtual display) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: xvfb-run bun test | |
| env: | |
| BUNLET_CLI_ROUNDTRIP: '1' | |
| - name: Run benchmark tests | |
| run: bun test packages/bunlet/src/benchmark.test.ts | |
| - name: Smoke-test examples | |
| if: matrix.os != 'ubuntu-latest' | |
| run: bun run smoke | |
| - name: Smoke-test examples (with virtual display) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: xvfb-run bun run smoke | |
| - name: Run doctor (post-build, must report clean) | |
| run: bun run doctor | |
| rust-check: | |
| name: Rust check | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| packages/bunlet-native -> target | |
| packages/bunlet-cef-native -> target | |
| - name: Check bunlet-native | |
| run: cargo check | |
| working-directory: packages/bunlet-native | |
| - name: Check bunlet-cef-native | |
| run: cargo check | |
| working-directory: packages/bunlet-cef-native | |
| build-native: | |
| name: Build native (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| platform: darwin-arm64 | |
| rust-target: aarch64-apple-darwin | |
| - os: macos-latest | |
| platform: darwin-x64 | |
| rust-target: x86_64-apple-darwin | |
| - os: ubuntu-latest | |
| platform: linux-x64 | |
| rust-target: x86_64-unknown-linux-gnu | |
| - os: windows-latest | |
| platform: win32-x64 | |
| rust-target: x86_64-pc-windows-msvc | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev pkg-config libxdo-dev | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.rust-target }} | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| packages/bunlet-native -> target | |
| packages/bunlet-cef-native -> target | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build bunlet-native | |
| env: | |
| CARGO_BUILD_TARGET: ${{ matrix.rust-target }} | |
| run: | | |
| cd packages/bunlet-native | |
| cargo build --release --target ${{ matrix.rust-target }} | |
| bun run scripts/copy-artifact.js | |
| - name: Build bunlet-cef-native | |
| id: build-cef | |
| env: | |
| CARGO_BUILD_TARGET: ${{ matrix.rust-target }} | |
| run: | | |
| cd packages/bunlet-cef | |
| cargo build --manifest-path ../bunlet-cef-native/Cargo.toml --release --target ${{ matrix.rust-target }} | |
| bun run copy-artifact | |
| - name: Upload bunlet-native artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bunlet-native-${{ matrix.platform }} | |
| path: packages/bunlet-native/*.node | |
| - name: Upload bunlet-cef artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bunlet-cef-${{ matrix.platform }} | |
| path: | | |
| packages/bunlet-cef/*.node | |
| packages/bunlet-cef/bunlet-cef-helper* | |
| if-no-files-found: warn | |
| binary-size: | |
| name: Binary size report | |
| runs-on: macos-latest | |
| needs: [build-native] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Download darwin-arm64 native addon | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bunlet-native-darwin-arm64 | |
| path: packages/bunlet-native | |
| - name: Download darwin-x64 native addon | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bunlet-native-darwin-x64 | |
| path: packages/bunlet-native | |
| - name: Download linux-x64 native addon | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bunlet-native-linux-x64 | |
| path: packages/bunlet-native | |
| - name: Measure binary sizes | |
| run: | | |
| echo "## Binary Size Report" >> $GITHUB_STEP_SUMMARY | |
| echo "| Asset | Size |" >> $GITHUB_STEP_SUMMARY | |
| echo "|-------|------|" >> $GITHUB_STEP_SUMMARY | |
| # macOS ARM64 native addon | |
| NATIVE_SIZE_DARWIN_ARM64=$(stat -f%z packages/bunlet-native/bunlet-native.darwin-arm64.node 2>/dev/null || echo "0") | |
| echo "| bunlet-native (macOS ARM64) | $(numfmt --to=iec $NATIVE_SIZE_DARWIN_ARM64 2>/dev/null || echo "${NATIVE_SIZE_DARWIN_ARM64} bytes") |" >> $GITHUB_STEP_SUMMARY | |
| # macOS x64 native addon | |
| NATIVE_SIZE_DARWIN_X64=$(stat -f%z packages/bunlet-native/bunlet-native.darwin-x64.node 2>/dev/null || echo "0") | |
| echo "| bunlet-native (macOS x64) | $(numfmt --to=iec $NATIVE_SIZE_DARWIN_X64 2>/dev/null || echo "${NATIVE_SIZE_DARWIN_X64} bytes") |" >> $GITHUB_STEP_SUMMARY | |
| # Linux x64 native addon | |
| NATIVE_SIZE_LINUX_X64=$(stat -c%s packages/bunlet-native/bunlet-native.linux-x64-gnu.node 2>/dev/null || echo "0") | |
| echo "| bunlet-native (Linux x64) | $(numfmt --to=iec $NATIVE_SIZE_LINUX_X64 2>/dev/null || echo "${NATIVE_SIZE_LINUX_X64} bytes") |" >> $GITHUB_STEP_SUMMARY | |
| # Core runtime bundle | |
| cd packages/bunlet | |
| BUILD_SIZE=$(wc -c < dist/index.js 2>/dev/null || echo "0") | |
| echo "| bunlet runtime | $(numfmt --to=iec $BUILD_SIZE 2>/dev/null || echo "${BUILD_SIZE} bytes") |" >> $GITHUB_STEP_SUMMARY | |
| - name: Check size budgets | |
| shell: bash | |
| run: | | |
| BUDGET=$((5 * 1024 * 1024)) | |
| check_size() { | |
| local file="$1" | |
| local label="$2" | |
| if [ -f "$file" ]; then | |
| local size | |
| if [[ "$OSTYPE" == "darwin"* ]]; then | |
| size=$(stat -f%z "$file") | |
| else | |
| size=$(stat -c%s "$file") | |
| fi | |
| if [ "$size" -gt "$BUDGET" ]; then | |
| echo "::warning::$label exceeds 5MB budget (${size} bytes)" | |
| fi | |
| fi | |
| } | |
| check_size packages/bunlet-native/bunlet-native.darwin-arm64.node "Native addon (macOS ARM64)" | |
| check_size packages/bunlet-native/bunlet-native.darwin-x64.node "Native addon (macOS x64)" | |
| check_size packages/bunlet-native/bunlet-native.linux-x64-gnu.node "Native addon (Linux x64)" |