diff --git a/.github/actions/setup-cmux/action.yml b/.github/actions/setup-cmux/action.yml index cedc49b38..ee3edb514 100644 --- a/.github/actions/setup-cmux/action.yml +++ b/.github/actions/setup-cmux/action.yml @@ -16,6 +16,42 @@ runs: restore-keys: | ${{ runner.os }}-bun- + - name: Cache Homebrew (macOS) + if: runner.os == 'macOS' + uses: actions/cache@v4 + with: + path: ~/Library/Caches/Homebrew + key: ${{ runner.os }}-brew-cache-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-brew-cache- + - name: Install dependencies shell: bash run: bun install --frozen-lockfile + + - name: Install ImageMagick (macOS) + if: runner.os == 'macOS' + shell: bash + run: | + if ! brew list imagemagick &>/dev/null; then + echo "📦 Installing ImageMagick..." + time brew install imagemagick + else + echo "✅ ImageMagick already installed" + brew list imagemagick --versions + fi + # Verify it's in PATH + which magick + magick --version | head -1 + + - name: Install ImageMagick (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + if ! command -v convert &> /dev/null; then + echo "Installing ImageMagick..." + sudo apt-get update -qq + sudo apt-get install -y imagemagick + else + echo "ImageMagick already installed" + fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f23dec92f..a221534d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,16 +9,13 @@ on: jobs: build-macos: name: Build macOS - runs-on: macos-latest + runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-15' || 'macos-latest' }} steps: - name: Checkout code uses: actions/checkout@v4 - uses: ./.github/actions/setup-cmux - - name: Install ImageMagick - run: brew install imagemagick - - name: Build application run: bun run build @@ -59,9 +56,6 @@ jobs: - uses: ./.github/actions/setup-cmux - - name: Install ImageMagick - run: sudo apt-get update && sudo apt-get install -y imagemagick - - name: Build application run: bun run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c4ec1d2b..4942e590d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,16 +10,13 @@ permissions: jobs: build-macos: name: Build and Release macOS - runs-on: macos-latest + runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-15' || 'macos-latest' }} steps: - name: Checkout code uses: actions/checkout@v4 - uses: ./.github/actions/setup-cmux - - name: Install ImageMagick - run: brew install imagemagick - - name: Build application run: bun run build @@ -33,7 +30,7 @@ jobs: AC_APIKEY_ISSUER_ID: ${{ secrets.AC_APIKEY_ISSUER_ID }} - name: Package and publish for macOS - run: bun x electron-builder --mac --publish always + run: make dist-mac-release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -46,9 +43,6 @@ jobs: - uses: ./.github/actions/setup-cmux - - name: Install ImageMagick - run: sudo apt-get update && sudo apt-get install -y imagemagick - - name: Build application run: bun run build diff --git a/Makefile b/Makefile index f1f5534d9..c1fd69737 100644 --- a/Makefile +++ b/Makefile @@ -161,8 +161,28 @@ test-e2e: ## Run end-to-end tests dist: build ## Build distributable packages @bun x electron-builder --publish never -dist-mac: build ## Build macOS distributable - @bun x electron-builder --mac --publish never +# Parallel macOS builds - notarization happens concurrently +dist-mac: build ## Build macOS distributables (x64 + arm64 in parallel) + @echo "Building macOS architectures in parallel..." + @bun x electron-builder --mac --x64 --publish never & \ + bun x electron-builder --mac --arm64 --publish never & \ + wait + @echo "✅ Both architectures built successfully" + +dist-mac-release: build ## Build and publish macOS distributables (x64 + arm64 in parallel) + @echo "Building and publishing macOS architectures in parallel..." + @bun x electron-builder --mac --x64 --publish always & \ + bun x electron-builder --mac --arm64 --publish always & \ + wait + @echo "✅ Both architectures built and published successfully" + +dist-mac-x64: build ## Build macOS x64 distributable only + @echo "Building macOS x64..." + @bun x electron-builder --mac --x64 --publish never + +dist-mac-arm64: build ## Build macOS arm64 distributable only + @echo "Building macOS arm64..." + @bun x electron-builder --mac --arm64 --publish never dist-win: build ## Build Windows distributable @bun x electron-builder --win --publish never diff --git a/package.json b/package.json index 35c955a3a..b01586917 100644 --- a/package.json +++ b/package.json @@ -120,16 +120,7 @@ ], "mac": { "category": "public.app-category.developer-tools", - "target": [ - { - "target": "dmg", - "arch": "x64" - }, - { - "target": "dmg", - "arch": "arm64" - } - ], + "target": "dmg", "icon": "build/icon.icns", "artifactName": "${productName}-${version}-${arch}.${ext}", "hardenedRuntime": true,