Skip to content

Keep the Claude session Switchboard was started from out of new sessions #200

Keep the Claude session Switchboard was started from out of new sessions

Keep the Claude session Switchboard was started from out of new sessions #200

Workflow file for this run

name: Build & Release
on:
push:
tags: ['v*']
pull_request:
branches: [main]
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
platform: mac
# Pinned, not `windows-latest`: that label has rolled over to Windows
# Server 2025, whose image no longer ships the Visual Studio C++
# toolchain node-gyp needs. On it, electron-builder's install-app-deps
# dies with "Could not find any Visual Studio installation to use"
# while rebuilding node-pty, so the Windows build never produces an
# artifact. 2022 still carries the toolchain.
- os: windows-2022
platform: win
# Linux is split per-arch to avoid electron-builder bundling native
# modules from the wrong architecture. When multiple targets (AppImage
# + deb) are built for multiple arches in one invocation, the native
# module rebuild only runs between arch switches for the first target
# type — the second target type reuses whatever was last compiled,
# which can be the wrong arch. See #18.
- os: ubuntu-latest
platform: linux
arch: x64
- os: ubuntu-24.04-arm
platform: linux
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Test postinstall helpers
run: node --test test/postinstall.test.js
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install setuptools (node-gyp distutils fix)
run: python -m pip install setuptools
- name: Install pacman build tooling (Linux)
if: matrix.platform == 'linux'
run: sudo apt-get update && sudo apt-get install -y libarchive-tools
- name: Install dependencies
run: npm ci
- name: Bundle editor and file previews
run: npm run bundle
- name: Build
run: npx electron-builder --${{ matrix.platform }} --publish never
env:
CSC_LINK: ${{ matrix.platform == 'mac' && secrets.CSC_LINK || '' }}
CSC_KEY_PASSWORD: ${{ matrix.platform == 'mac' && secrets.CSC_KEY_PASSWORD || '' }}
CSC_IDENTITY_AUTO_DISCOVERY: ${{ matrix.platform == 'mac' }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.platform }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }}
path: |
dist/*.dmg
dist/*.dmg.blockmap
dist/*.zip
dist/*.zip.blockmap
dist/*.exe
dist/*.exe.blockmap
dist/*.AppImage
dist/*.deb
dist/*.pacman
dist/latest*.yml
if-no-files-found: ignore
publish:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Create or update draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh release view "${GITHUB_REF_NAME}" --json isDraft > release.json; then
if [ "$(jq -r .isDraft release.json)" != "true" ]; then
echo "Refusing to replace assets on a published release" >&2
exit 1
fi
gh release upload "${GITHUB_REF_NAME}" --clobber dist/*
else
gh release create "${GITHUB_REF_NAME}" \
--draft \
--title "${GITHUB_REF_NAME#v}" \
--notes "" \
dist/*
fi