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
29 changes: 26 additions & 3 deletions .github/workflows/code-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
include:
- arch: arm64
runner: macos-15-arm64
runner: macos-15
- arch: x64
runner: macos-15-intel
runs-on: ${{ matrix.runner }}
Expand Down Expand Up @@ -134,11 +134,34 @@ jobs:
- name: Build native modules
run: pnpm --filter code run build-native

- name: Publish with Electron Forge
- name: Build release artifacts
env:
APP_VERSION: ${{ steps.version.outputs.version }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: pnpm --filter code exec electron-forge publish --dry-run --arch=${{ matrix.arch }} --platform=darwin

- name: Install Playwright
run: pnpm --filter code exec playwright install

- name: Smoke test packaged app
env:
CI: true
E2E_APP_ARCH: ${{ matrix.arch }}
run: pnpm --filter code exec playwright test --config=tests/e2e/playwright.config.ts tests/e2e/tests/smoke.spec.ts

- name: Upload Playwright report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: release-playwright-report-macos-${{ matrix.arch }}
path: apps/code/playwright-report/
retention-days: 7

- name: Publish release artifacts
env:
APP_VERSION: ${{ steps.version.outputs.version }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: pnpm --filter code exec electron-forge publish --arch=${{ matrix.arch }} --platform=darwin
run: pnpm --filter code exec electron-forge publish --from-dry-run

publish-windows:
runs-on: windows-latest
Expand Down
11 changes: 11 additions & 0 deletions apps/code/tests/e2e/fixtures/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {

function getAppPath(): string {
const outDir = path.join(__dirname, "../../../out");
const requestedArch = process.env.E2E_APP_ARCH;

if (process.platform === "darwin") {
const arm64Path = path.join(
Expand All @@ -20,6 +21,16 @@ function getAppPath(): string {
"PostHog Code-darwin-x64/PostHog Code.app/Contents/MacOS/PostHog Code",
);

if (requestedArch === "arm64") {
if (existsSync(arm64Path)) return arm64Path;
throw new Error(`No darwin-arm64 packaged app found at ${arm64Path}.`);
}

if (requestedArch === "x64") {
if (existsSync(x64Path)) return x64Path;
throw new Error(`No darwin-x64 packaged app found at ${x64Path}.`);
}

if (existsSync(arm64Path)) return arm64Path;
if (existsSync(x64Path)) return x64Path;

Expand Down
Loading