Files
Maestro/.github/workflows/release.yml
Pedram Amini 94c9bc90a4 fix: Resolve macOS and Linux build failures in release workflow
- Use Python 3.11 for macOS builds (Python 3.12+ removed distutils module needed by node-gyp)
- Add author email to package.json (required for Linux .deb package maintainer field)
2025-11-26 22:38:52 -06:00

165 lines
4.3 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'
- 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
# 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
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
DEBUG: electron-builder
- name: Package for Windows
if: matrix.platform == 'win'
run: npx electron-builder --win --publish never
env:
DEBUG: electron-builder
- name: Package for Linux
if: matrix.platform == 'linux'
run: npx electron-builder --linux --publish never
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
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List downloaded artifacts
run: find artifacts -type f | head -50
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/maestro-macos/*
artifacts/maestro-windows/*
artifacts/maestro-linux/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}