Prevent split-brain IPC masters and surface reusable sessions #12
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: Release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| paths: | |
| - 'src/**' | |
| - 'src-tauri/**' | |
| - 'cli/**' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'tsconfig*.json' | |
| - 'vite.config.ts' | |
| - 'tailwind.config.js' | |
| - 'postcss.config.js' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/release.yml' | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: 'Version bump type' | |
| required: false | |
| default: 'patch' | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| bump-and-release: | |
| name: Bump Version & Create Release | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'chore: bump version')" | |
| outputs: | |
| release_id: ${{ steps.create_release.outputs.id }} | |
| version: ${{ steps.bump.outputs.new_version }} | |
| tag_name: ${{ steps.bump.outputs.tag_name }} | |
| should_build: ${{ steps.bump.outputs.should_build }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Bump version | |
| id: bump | |
| run: | | |
| CURRENT=$(jq -r .version src-tauri/tauri.conf.json) | |
| echo "Current version: $CURRENT" | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| NEW_VERSION="${GITHUB_REF#refs/tags/v}" | |
| echo "Tag push: using version $NEW_VERSION" | |
| elif [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then | |
| BUMP="${{ github.event.inputs.bump }}" | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" | |
| case "$BUMP" in | |
| major) NEW_VERSION="$((MAJOR+1)).0.0" ;; | |
| minor) NEW_VERSION="${MAJOR}.$((MINOR+1)).0" ;; | |
| patch) NEW_VERSION="${MAJOR}.${MINOR}.$((PATCH+1))" ;; | |
| esac | |
| else | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" | |
| NEW_VERSION="${MAJOR}.${MINOR}.$((PATCH+1))" | |
| echo "Branch push: auto bumping patch $CURRENT → $NEW_VERSION" | |
| fi | |
| TAG_NAME="v${NEW_VERSION}" | |
| echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | |
| echo "should_build=true" >> $GITHUB_OUTPUT | |
| # Update version in config files (only for non-tag pushes) | |
| if [[ "$GITHUB_REF" != refs/tags/v* ]]; then | |
| jq --arg v "$NEW_VERSION" '.version = $v' src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json | |
| jq --arg v "$NEW_VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json | |
| sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" Cargo.toml | |
| fi | |
| - name: Commit version bump | |
| if: github.ref != 'refs/tags/*' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if git diff --quiet; then | |
| echo "No version changes to commit" | |
| else | |
| git add src-tauri/tauri.conf.json package.json Cargo.toml | |
| git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }} [skip ci]" | |
| git push origin HEAD:${{ github.ref_name }} | |
| fi | |
| - name: Create release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.bump.outputs.tag_name }} | |
| name: VibeShell ${{ steps.bump.outputs.tag_name }} | |
| body: | | |
| ## VibeShell ${{ steps.bump.outputs.tag_name }} | |
| ### Downloads | |
| | Platform | Installer | CLI Only | | |
| |----------|-----------|----------| | |
| | Windows x64 | `.exe` / `.msi` | `vshell-windows-x64.exe` | | |
| | macOS (Apple Silicon) | `.dmg` | `vshell-macos-arm64` | | |
| | macOS (Intel) | `.dmg` | `vshell-macos-x64` | | |
| | Linux x64 | `.deb` / `.AppImage` | `vshell-linux-x64` | | |
| > **Note:** The desktop installer includes `vshell` CLI and adds it to your PATH automatically. | |
| See [commit history](https://github.com/${{ github.repository }}/commits/${{ steps.bump.outputs.tag_name }}) for full changes. | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-tauri: | |
| name: Build (${{ matrix.name }}) | |
| needs: bump-and-release | |
| if: needs.bump-and-release.outputs.should_build == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: windows-latest | |
| name: Windows x64 | |
| args: '' | |
| target: x86_64-pc-windows-msvc | |
| - platform: macos-latest | |
| name: macOS ARM64 | |
| args: '--target aarch64-apple-darwin' | |
| target: aarch64-apple-darwin | |
| - platform: macos-latest | |
| name: macOS x64 | |
| args: '--target x86_64-apple-darwin' | |
| target: x86_64-apple-darwin | |
| - platform: ubuntu-22.04 | |
| name: Linux x64 | |
| args: '' | |
| target: x86_64-unknown-linux-gnu | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Install Linux dependencies | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './src-tauri -> target' | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Build vshell CLI | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.target }}" != "" && "${{ matrix.args }}" == *"--target"* ]]; then | |
| cargo build --release --package vshell --target ${{ matrix.target }} | |
| else | |
| cargo build --release --package vshell | |
| fi | |
| - name: Copy vshell to sidecar location | |
| shell: bash | |
| run: | | |
| mkdir -p src-tauri/binaries | |
| TARGET="${{ matrix.target }}" | |
| EXT="" | |
| if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then | |
| EXT=".exe" | |
| fi | |
| # Determine source path | |
| if [[ "${{ matrix.args }}" == *"--target"* ]]; then | |
| SRC="target/${TARGET}/release/vshell${EXT}" | |
| else | |
| SRC="target/release/vshell${EXT}" | |
| fi | |
| DEST="src-tauri/binaries/vshell-${TARGET}${EXT}" | |
| echo "Copying $SRC -> $DEST" | |
| cp "$SRC" "$DEST" | |
| chmod +x "$DEST" 2>/dev/null || true | |
| ls -la src-tauri/binaries/ | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| releaseId: ${{ needs.bump-and-release.outputs.release_id }} | |
| args: ${{ matrix.args }} | |
| - name: Rename and upload vshell CLI binary | |
| shell: bash | |
| run: | | |
| VERSION="${{ needs.bump-and-release.outputs.version }}" | |
| TARGET="${{ matrix.target }}" | |
| EXT="" | |
| if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then | |
| EXT=".exe" | |
| fi | |
| # Find the built vshell binary | |
| if [[ "${{ matrix.args }}" == *"--target"* ]]; then | |
| BINARY="target/${TARGET}/release/vshell${EXT}" | |
| else | |
| BINARY="target/release/vshell${EXT}" | |
| fi | |
| # Determine platform-friendly name | |
| case "${{ matrix.platform }}" in | |
| windows-latest) | |
| DEST="vshell-${VERSION}-windows-x64.exe" | |
| ;; | |
| macos-latest) | |
| if [[ "${{ matrix.args }}" == *"aarch64"* ]]; then | |
| DEST="vshell-${VERSION}-macos-arm64" | |
| else | |
| DEST="vshell-${VERSION}-macos-x64" | |
| fi | |
| ;; | |
| ubuntu-22.04) | |
| DEST="vshell-${VERSION}-linux-x64" | |
| ;; | |
| esac | |
| if [ -f "$BINARY" ]; then | |
| cp "$BINARY" "$DEST" | |
| echo "VSHELL_BINARY=$DEST" >> $GITHUB_ENV | |
| else | |
| echo "Warning: vshell binary not found at $BINARY" | |
| fi | |
| - name: Upload vshell CLI to release | |
| if: env.VSHELL_BINARY != '' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.bump-and-release.outputs.tag_name }} | |
| files: ${{ env.VSHELL_BINARY }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |