mirror of
https://github.com/jlengrand/Maestro.git
synced 2026-03-10 08:31:19 +00:00
- Add ghPath setting to specify custom path to gh binary (e.g., /opt/homebrew/bin/gh) - Update git:checkGhCli and git:createPR IPC handlers to accept optional ghPath - Add UI in Settings > General for configuring the gh path - Pass ghPath through BatchRunnerModal and useBatchProcessor for PR creation - Include test infrastructure setup (vitest) and misc updates Claude ID: 295a322c-974c-4b49-b31d-f7be18819332 Maestro ID: b9bc0d08-5be2-4fdf-93cd-5618a8d53b35
258 lines
8.1 KiB
YAML
258 lines
8.1 KiB
YAML
name: Release Maestro
|
|
|
|
# This workflow is triggered only by git tags (trusted input)
|
|
# No user-controlled data is executed in shell commands
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*' # Semantic version tags (e.g., v1.0.0)
|
|
- '20*' # Date-based tags (e.g., 2025-11-27)
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
platform: mac
|
|
arch: universal
|
|
- os: ubuntu-latest
|
|
platform: linux
|
|
arch: x64
|
|
- os: windows-latest
|
|
platform: win
|
|
arch: x64
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
# Linux: Install build dependencies for native modules and electron-builder
|
|
- name: Install Linux build dependencies
|
|
if: matrix.platform == 'linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libarchive-tools rpm
|
|
|
|
# Windows: Setup for native module compilation
|
|
- name: Setup Windows build tools
|
|
if: matrix.platform == 'win'
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
# macOS: Setup Python 3.11 for node-gyp (Python 3.12+ removed distutils)
|
|
- name: Setup Python for node-gyp
|
|
if: matrix.platform == 'mac'
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
# Extract version from git tag for use in build steps
|
|
- name: Set version from tag
|
|
id: version
|
|
shell: bash
|
|
env:
|
|
REF_TYPE: ${{ github.ref_type }}
|
|
REF_NAME: ${{ github.ref_name }}
|
|
run: |
|
|
if [[ "$REF_TYPE" == "tag" ]]; then
|
|
VERSION="${REF_NAME#v}"
|
|
else
|
|
VERSION=$(node -p "require('./package.json').version")
|
|
fi
|
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "Using version: $VERSION"
|
|
|
|
# Update package.json with the release version
|
|
# This ensures CLI and other components read the correct version
|
|
- name: Update package.json version
|
|
shell: bash
|
|
env:
|
|
VERSION: ${{ steps.version.outputs.VERSION }}
|
|
run: |
|
|
node -e "
|
|
const fs = require('fs');
|
|
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
pkg.version = process.env.VERSION;
|
|
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
"
|
|
echo "Updated package.json to version $VERSION"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
# Rebuild native modules for the target platform
|
|
- name: Rebuild native modules
|
|
run: npm run postinstall
|
|
env:
|
|
npm_config_build_from_source: true
|
|
|
|
- name: Build application
|
|
run: npm run build
|
|
env:
|
|
VITE_APP_VERSION: ${{ steps.version.outputs.VERSION }}
|
|
|
|
# List release directory before packaging for debugging
|
|
- name: Create release directory
|
|
run: mkdir -p release
|
|
shell: bash
|
|
|
|
- name: Package for macOS
|
|
if: matrix.platform == 'mac'
|
|
run: npx electron-builder --mac --publish never --config.extraMetadata.version=${{ steps.version.outputs.VERSION }}
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
CSC_LINK: ""
|
|
DEBUG: electron-builder
|
|
|
|
# Ad-hoc sign macOS apps and re-create archives
|
|
# Fixes "code has no resources but signature indicates they must be present"
|
|
- name: Ad-hoc sign macOS apps
|
|
if: matrix.platform == 'mac'
|
|
run: |
|
|
VERSION=${{ steps.version.outputs.VERSION }}
|
|
|
|
# Sign x64 app and recreate zip
|
|
if [ -d "release/mac/Maestro.app" ]; then
|
|
echo "Ad-hoc signing: release/mac/Maestro.app"
|
|
codesign --sign - --deep --force "release/mac/Maestro.app"
|
|
echo "Re-creating ZIP for x64..."
|
|
rm -f "release/Maestro-${VERSION}-mac.zip"
|
|
cd release/mac && zip -r -y "../Maestro-${VERSION}-mac.zip" Maestro.app && cd ../..
|
|
fi
|
|
|
|
# Sign arm64 app and recreate zip
|
|
if [ -d "release/mac-arm64/Maestro.app" ]; then
|
|
echo "Ad-hoc signing: release/mac-arm64/Maestro.app"
|
|
codesign --sign - --deep --force "release/mac-arm64/Maestro.app"
|
|
echo "Re-creating ZIP for arm64..."
|
|
rm -f "release/Maestro-${VERSION}-arm64-mac.zip"
|
|
cd release/mac-arm64 && zip -r -y "../Maestro-${VERSION}-arm64-mac.zip" Maestro.app && cd ../..
|
|
fi
|
|
|
|
- name: Package for Windows
|
|
if: matrix.platform == 'win'
|
|
shell: bash
|
|
run: npx electron-builder --win --publish never --config.extraMetadata.version=${{ steps.version.outputs.VERSION }}
|
|
env:
|
|
DEBUG: electron-builder
|
|
|
|
- name: Package for Linux
|
|
if: matrix.platform == 'linux'
|
|
run: npx electron-builder --linux --publish never --config.extraMetadata.version=${{ steps.version.outputs.VERSION }}
|
|
env:
|
|
DEBUG: electron-builder
|
|
|
|
# List what was built for debugging
|
|
- name: List release artifacts
|
|
run: ls -la release/
|
|
shell: bash
|
|
|
|
- name: Upload macOS artifacts
|
|
if: matrix.platform == 'mac'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: maestro-macos
|
|
path: |
|
|
release/*.dmg
|
|
release/*.zip
|
|
release/*-mac.zip
|
|
release/*-mac-*.zip
|
|
if-no-files-found: error
|
|
retention-days: 5
|
|
|
|
- name: Upload Windows artifacts
|
|
if: matrix.platform == 'win'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: maestro-windows
|
|
path: |
|
|
release/*.exe
|
|
if-no-files-found: error
|
|
retention-days: 5
|
|
|
|
- name: Upload Linux artifacts
|
|
if: matrix.platform == 'linux'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: maestro-linux
|
|
path: |
|
|
release/*.AppImage
|
|
release/*.deb
|
|
release/*.rpm
|
|
release/*.snap
|
|
if-no-files-found: warn
|
|
retention-days: 5
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
# Run release even if some builds failed (fail-fast: false allows partial success)
|
|
if: always() && startsWith(github.ref, 'refs/tags/') && needs.build.result != 'cancelled'
|
|
|
|
steps:
|
|
# Download each platform's artifacts separately to handle partial failures
|
|
- name: Download macOS artifacts
|
|
uses: actions/download-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: maestro-macos
|
|
path: artifacts/maestro-macos
|
|
|
|
- name: Download Windows artifacts
|
|
uses: actions/download-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: maestro-windows
|
|
path: artifacts/maestro-windows
|
|
|
|
- name: Download Linux artifacts
|
|
uses: actions/download-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: maestro-linux
|
|
path: artifacts/maestro-linux
|
|
|
|
- name: List downloaded artifacts
|
|
run: |
|
|
echo "Available artifacts:"
|
|
find artifacts -type f 2>/dev/null || echo "No artifacts found"
|
|
|
|
- name: Check for any artifacts
|
|
id: check_artifacts
|
|
run: |
|
|
if find artifacts -type f 2>/dev/null | grep -q .; then
|
|
echo "has_artifacts=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "has_artifacts=false" >> $GITHUB_OUTPUT
|
|
echo "::error::No artifacts were built successfully"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Create Release
|
|
if: steps.check_artifacts.outputs.has_artifacts == 'true'
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
artifacts/maestro-macos/*
|
|
artifacts/maestro-windows/*
|
|
artifacts/maestro-linux/*
|
|
fail_on_unmatched_files: false
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|