Skip to content

Update main.py

Update main.py #9

Workflow file for this run

name: Build CLI Binaries
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version tag (e.g., v1.0.0)"
required: false
default: "dev"
jobs:
build:
strategy:
matrix:
include:
- os: macos-14 # Apple Silicon
platform: darwin
arch: arm64
- os: macos-15-intel # Intel (macos-13 deprecated Dec 2025)
platform: darwin
arch: amd64
- os: ubuntu-latest
platform: linux
arch: amd64
# Note: Linux arm64 would need self-hosted runner or QEMU
# - os: ubuntu-latest
# platform: linux
# arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build binary
run: |
# Build with PyInstaller - uses system Chrome at runtime (channel="chrome")
pyinstaller \
--onefile \
--name hyperaide-sync-${{ matrix.platform }}-${{ matrix.arch }} \
--hidden-import playwright \
--hidden-import playwright.sync_api \
--collect-all playwright \
main.py
- name: Test binary
run: ./dist/hyperaide-sync-${{ matrix.platform }}-${{ matrix.arch }} --help || true
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: hyperaide-sync-${{ matrix.platform }}-${{ matrix.arch }}
path: dist/hyperaide-sync-${{ matrix.platform }}-${{ matrix.arch }}*
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write # Required for creating releases
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare binaries
run: |
mkdir -p binaries
find artifacts -type f -name "hyperaide-sync-*" -exec cp {} binaries/ \;
echo "=== Binaries to release ==="
ls -la binaries/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: binaries/*
generate_release_notes: true
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}