Build #24
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
| # Builds run only manually (workflow_dispatch). No automatic build on push or tags. | |
| name: Build | |
| on: | |
| workflow_dispatch: | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-package: | |
| name: build-package | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: read | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install UV | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build dependencies | |
| run: | | |
| uv sync --dev | |
| uv pip install twine | |
| - name: Build package | |
| run: | | |
| uv build | |
| - name: Check package | |
| run: | | |
| uv run twine check dist/* | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.os }} | |
| path: dist/* | |
| retention-days: 7 | |
| build-windows-exe: | |
| name: build-windows-exe | |
| needs: build-package # Wait for package build first | |
| runs-on: windows-latest | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: read | |
| actions: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install UV | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| uv sync --dev | |
| uv pip install pyinstaller | |
| - name: Build Windows executable (Terminal Dashboard only) | |
| shell: pwsh | |
| run: | | |
| # Use spec file if it exists, otherwise use command-line args | |
| if (Test-Path dev/pyinstaller.spec) { | |
| uv run pyinstaller --clean dev/pyinstaller.spec | |
| } else { | |
| uv run pyinstaller --onefile --name bitonic --console ccbt/interface/terminal_dashboard.py | |
| } | |
| # Verify executable was created | |
| if (-not (Test-Path dist/bitonic.exe)) { | |
| Write-Error "Error: bitonic.exe was not created" | |
| Get-ChildItem dist/ -Recurse | Select-Object FullName | |
| exit 1 | |
| } | |
| Write-Host "✅ Windows executable built successfully: dist/bitonic.exe" | |
| Get-Item dist/bitonic.exe | Select-Object Name, Length, LastWriteTime | |
| - name: Upload Windows executable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-executable | |
| path: dist/bitonic.exe | |
| retention-days: 30 |