v0.7.0-beta.0 #192
Workflow file for this run
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: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to release (e.g., v0.0.19 or v0.0.19-beta.1)' | |
| required: true | |
| prerelease: | |
| description: 'Is this a pre-release?' | |
| type: boolean | |
| default: false | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-14 | |
| platform: darwin | |
| arch: arm64 | |
| platform_name: darwin | |
| - os: macos-15-intel | |
| platform: darwin | |
| arch: x64 | |
| platform_name: darwin | |
| - os: ubuntu-24.04 | |
| platform: linux | |
| arch: x64 | |
| platform_name: linux | |
| - os: ubuntu-24.04-arm | |
| platform: linux | |
| arch: arm64 | |
| platform_name: linux | |
| - os: windows-2025 | |
| platform: win32 | |
| arch: x64 | |
| platform_name: win | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 1.3.0 | |
| - name: Install dependencies | |
| run: bun install | |
| working-directory: package | |
| - name: Setup MSVC Developer Command Prompt | |
| if: matrix.platform == 'win32' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| - name: Install Linux build dependencies | |
| if: matrix.platform == 'linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libgtk-3-dev \ | |
| libayatana-appindicator3-dev \ | |
| build-essential \ | |
| cmake \ | |
| pkg-config | |
| - name: Build for ${{ matrix.platform_name }}-${{ matrix.arch }} | |
| run: bun scripts/package-release.js | |
| working-directory: package | |
| # timeout-minutes: 30 | |
| - name: Upload CLI artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: electrobun-cli-${{ matrix.platform_name }}-${{ matrix.arch }} | |
| path: package/electrobun-cli-${{ matrix.platform_name }}-${{ matrix.arch }}.tar.gz | |
| - name: Upload core artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: electrobun-core-${{ matrix.platform_name }}-${{ matrix.arch }} | |
| path: package/electrobun-core-${{ matrix.platform_name }}-${{ matrix.arch }}.tar.gz | |
| - name: Upload CEF artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: electrobun-cef-${{ matrix.platform_name }}-${{ matrix.arch }} | |
| path: package/electrobun-cef-${{ matrix.platform_name }}-${{ matrix.arch }}.tar.gz | |
| if-no-files-found: ignore | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag || github.ref_name }} | |
| files: | | |
| artifacts/**/*.tar.gz | |
| generate_release_notes: false | |
| prerelease: ${{ github.event.inputs.prerelease || contains(github.ref_name, '-beta') || contains(github.event.inputs.tag, '-beta') }} | |
| body: | | |
| Electrobun release | |
| **CLI only**: `electrobun-cli-[platform]-[arch].tar.gz` | |
| **Core binaries**: `electrobun-core-[platform]-[arch].tar.gz` | |
| **CEF binaries** (optional): `electrobun-cef-[platform]-[arch].tar.gz` | |
| npm-publish: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 1.3.0 | |
| - name: Install dependencies | |
| run: bun install | |
| working-directory: package | |
| - name: Build for npm (JS/TS files only) | |
| run: | | |
| # Use the new --npm flag to build only what's needed for npm | |
| bun build.ts --npm --release | |
| echo "Contents of dist/ for npm (should only be main.js and api/):" | |
| find dist/ -type f | sort | |
| working-directory: package | |
| - name: Publish to npm | |
| run: | | |
| if [[ "${{ github.event.inputs.tag || github.ref_name }}" == *"beta"* ]]; then | |
| echo "Publishing beta release to npm..." | |
| npm publish --tag beta | |
| else | |
| echo "Publishing stable release to npm..." | |
| npm publish | |
| fi | |
| working-directory: package | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |