-
Notifications
You must be signed in to change notification settings - Fork 33
Add standalone executable builds for macOS and Windows #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
ed1f60e
Initial plan
Copilot cd45500
Add documentation for standalone executables and build process
Copilot 0064df4
Add building executables documentation to index and fix doc warnings
Copilot f9293f0
Include OID cache and fix HTML file paths in PyInstaller specs
Copilot cef51c8
Fix code review issues: remove macOS icon reference and use safe geta…
Copilot ac44f1c
Add PR trigger to build workflow and increase artifact retention to 3…
Copilot e856e3d
Fix double-zipping issue: upload uncompressed directories as artifacts
Copilot 9960215
Add standalone executable builds for macOS and Windows
Copilot feedd6c
Fix macOS artifact structure and include _version.py in PyInstaller b…
Copilot 8eb71a0
Fix download steps to use temporary directories for extraction
Copilot e8e9689
Fix permission errors when deleting macOS temp directories
Copilot cfac21c
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Copilot 299d827
Update .github/workflows/release-executables.yml
thawn 94b0f9a
Update .github/workflows/release-executables.yml
thawn 1bc3cc9
Update .github/workflows/release-executables.yml
thawn e9eb7dd
Update .github/workflows/release-executables.yml
thawn e5712fa
Update .github/workflows/release-executables.yml
thawn 5281a0a
Add verbose diagnostics for macOS tttool binary execution error
Copilot 484dd65
Update .github/workflows/release-executables.yml
thawn 9a5d9ec
Fix permissions and quarantine removal for macOS binaries
thawn a1387bc
Update tttool version to 1.11 for macOS download
thawn 1fc1622
Update .github/workflows/release-executables.yml
thawn 4e02318
Update .github/workflows/release-executables.yml
thawn 78abf37
Update .github/workflows/release-executables.yml
thawn e6f8aff
Clean up release-executables.yml by removing unnecessary steps
thawn ac7bfae
Add standalone executable builds for macOS and Windows
Copilot 9974b67
Revert wrapper script changes that caused macOS execution error
Copilot 5ff639e
Fix _version.py import by treating it as a Python module instead of d…
Copilot 490aa28
Include _version.py as a data file rather than Python module to fix i…
Copilot cbb71dc
Move version import to a different location
thawn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| 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 }} | ||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.