Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ed1f60e
Initial plan
Copilot Jan 2, 2026
cd45500
Add documentation for standalone executables and build process
Copilot Jan 2, 2026
0064df4
Add building executables documentation to index and fix doc warnings
Copilot Jan 2, 2026
f9293f0
Include OID cache and fix HTML file paths in PyInstaller specs
Copilot Jan 2, 2026
cef51c8
Fix code review issues: remove macOS icon reference and use safe geta…
Copilot Jan 2, 2026
ac44f1c
Add PR trigger to build workflow and increase artifact retention to 3…
Copilot Jan 2, 2026
e856e3d
Fix double-zipping issue: upload uncompressed directories as artifacts
Copilot Jan 2, 2026
9960215
Add standalone executable builds for macOS and Windows
Copilot Jan 2, 2026
feedd6c
Fix macOS artifact structure and include _version.py in PyInstaller b…
Copilot Jan 2, 2026
8eb71a0
Fix download steps to use temporary directories for extraction
Copilot Jan 2, 2026
e8e9689
Fix permission errors when deleting macOS temp directories
Copilot Jan 2, 2026
cfac21c
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Copilot Jan 2, 2026
299d827
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
94b0f9a
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
1bc3cc9
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
e9eb7dd
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
e5712fa
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
5281a0a
Add verbose diagnostics for macOS tttool binary execution error
Copilot Jan 2, 2026
484dd65
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
9a5d9ec
Fix permissions and quarantine removal for macOS binaries
thawn Jan 2, 2026
a1387bc
Update tttool version to 1.11 for macOS download
thawn Jan 2, 2026
1fc1622
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
4e02318
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
78abf37
Update .github/workflows/release-executables.yml
thawn Jan 2, 2026
e6f8aff
Clean up release-executables.yml by removing unnecessary steps
thawn Jan 2, 2026
ac7bfae
Add standalone executable builds for macOS and Windows
Copilot Jan 2, 2026
9974b67
Revert wrapper script changes that caused macOS execution error
Copilot Jan 2, 2026
5ff639e
Fix _version.py import by treating it as a Python module instead of d…
Copilot Jan 2, 2026
490aa28
Include _version.py as a data file rather than Python module to fix i…
Copilot Jan 3, 2026
cbb71dc
Move version import to a different location
thawn Jan 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 227 additions & 0 deletions .github/workflows/release-executables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
name: Build and Release Executables

on:
release:
types: [published]
pull_request:
paths:
- 'src/**'
- 'resources/**'
- 'ttmp32gme-*.spec'
- 'pyproject.toml'
- '.github/workflows/release-executables.yml'
workflow_dispatch:
inputs:
tag:
description: 'Release tag (e.g., v2.0.0)'
required: true

permissions:
contents: write

jobs:
build-windows:
name: Build Windows Executable
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[build]"

- name: Download tttool for Windows
run: |
$TTTOOL_VERSION = "1.8.1"
Write-Host "Downloading tttool version $TTTOOL_VERSION for Windows"

# Create lib/win directory if it doesn't exist
New-Item -ItemType Directory -Force -Path lib/win

# Download tttool to temp directory
$tempDir = New-Item -ItemType Directory -Path (Join-Path $env:TEMP "tttool-temp-$(Get-Random)")
$url = "https://github.com/entropia/tip-toi-reveng/releases/download/${TTTOOL_VERSION}/tttool-${TTTOOL_VERSION}.zip"
$zipPath = Join-Path $tempDir "tttool.zip"
Invoke-WebRequest -Uri $url -OutFile $zipPath

# Extract to temp directory and move binary
Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force
Move-Item -Path (Join-Path $tempDir "tttool.exe") -Destination lib/win/tttool.exe -Force

# Cleanup temp directory
Remove-Item -Recurse -Force $tempDir

# Verify
lib/win/tttool.exe --help

- name: Download ffmpeg for Windows
run: |
Write-Host "Downloading ffmpeg for Windows"

# Download ffmpeg to temp directory
$tempDir = New-Item -ItemType Directory -Path (Join-Path $env:TEMP "ffmpeg-temp-$(Get-Random)")
$url = "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip"
$zipPath = Join-Path $tempDir "ffmpeg.zip"
Invoke-WebRequest -Uri $url -OutFile $zipPath

# Extract to temp directory
Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force

# Find and move ffmpeg.exe
$ffmpegDir = Get-ChildItem -Path $tempDir -Directory -Filter "ffmpeg-*" | Select-Object -First 1
Move-Item -Path (Join-Path $ffmpegDir.FullName "bin/ffmpeg.exe") -Destination lib/win/ffmpeg.exe -Force

# Cleanup temp directory
Remove-Item -Recurse -Force $tempDir

# Verify
lib/win/ffmpeg.exe -version

- name: Build Windows executable with PyInstaller
run: |
pyinstaller ttmp32gme-windows.spec --clean

- name: Upload Windows executable
uses: actions/upload-artifact@v4
with:
name: ttmp32gme-windows
path: dist/ttmp32gme
retention-days: 30

- name: Create ZIP archive for release
if: github.event_name == 'release'
run: |
cd dist
Compress-Archive -Path ttmp32gme -DestinationPath ttmp32gme-windows.zip

- name: Upload to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: dist/ttmp32gme-windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-macos:
name: Build macOS Executable
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[build]"

- name: Download tttool for macOS
run: |
TTTOOL_VERSION="1.11"
echo "Downloading tttool version $TTTOOL_VERSION for macOS"

# Create lib/mac directory if it doesn't exist
mkdir -p lib/mac

# Create temp directory for extraction
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"

# Download and extract tttool
wget -q "https://github.com/entropia/tip-toi-reveng/releases/download/${TTTOOL_VERSION}/tttool-${TTTOOL_VERSION}.zip"
unzip -q "tttool-${TTTOOL_VERSION}.zip"
cd tttool-1.11/osx

# Move binary and dynamic libraries to lib/mac
chmod +x tttool
mv tttool "$GITHUB_WORKSPACE/lib/mac/tttool"

# Copy all .dylib files if they exist
if ls *.dylib 1> /dev/null 2>&1; then
mv *.dylib "$GITHUB_WORKSPACE/lib/mac/"
fi

# Cleanup temp directory - change permissions first to ensure deletion succeeds
cd "$GITHUB_WORKSPACE"
chmod -R u+w "$TEMP_DIR" || true
rm -rf "$TEMP_DIR"

# Verify - check architecture and try to run
lib/mac/tttool --help || {
echo "Failed to execute tttool"
echo "Exit code: $?"
echo "Checking otool dependencies:"
otool -L lib/mac/tttool || echo "otool failed"
exit 1
}

- name: Download ffmpeg for macOS
run: |
echo "Downloading ffmpeg for macOS"

# Create temp directory for extraction
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"

# Download ffmpeg static build for macOS
wget -q "https://evermeet.cx/ffmpeg/getrelease/ffmpeg/zip" -O ffmpeg.zip
unzip -q ffmpeg.zip

# Move binary to lib/mac
chmod +x ffmpeg
mv ffmpeg "$GITHUB_WORKSPACE/lib/mac/ffmpeg"

# Cleanup temp directory - change permissions first to ensure deletion succeeds
cd "$GITHUB_WORKSPACE"
chmod -R u+w "$TEMP_DIR" || true
rm -rf "$TEMP_DIR"

# Verify
lib/mac/ffmpeg -version

- name: Build macOS executable with PyInstaller
run: |
pyinstaller ttmp32gme-macos.spec --clean

- name: Prepare macOS artifact
run: |
# Create a clean artifact directory with the .app bundle
mkdir -p artifact-macos
cp -R dist/ttmp32gme.app artifact-macos/

- name: Upload macOS executable
uses: actions/upload-artifact@v4
with:
name: ttmp32gme-macos
path: artifact-macos/
retention-days: 30

- name: Create ZIP archive for release
if: github.event_name == 'release'
run: |
cd dist
# For now, create a ZIP. Later we can create a proper DMG
zip -r ttmp32gme-macos.zip ttmp32gme.app

- name: Upload to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: dist/ttmp32gme-macos.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ google-chrome-stable_current_amd64.deb

# Pre-commit
.pre-commit-config.yaml.bak

# PyInstaller build artifacts
*.spec.bak
build/
!build/docker/
!build/mac/
!build/win/
dist/
*.pyc
Loading
Loading