fix(build): move requires-python and dependencies back into [project] #17
Workflow file for this run
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
| name: Build & Release | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version override (leave empty to read from package.json)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| env: | |
| # Prevents PySide6 from requiring a display during build | |
| QT_QPA_PLATFORM: offscreen | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgl1-mesa-dev libegl1-mesa-dev libxkbcommon0 libfontconfig1 \ | |
| libdbus-1-3 libxcb-xinerama0 libxcb-cursor0 libxcb-shape0 \ | |
| libxcb-icccm4 libxcb-keysyms1 libxcb-render-util0 libxcb-image0 \ | |
| libnss3 libasound2 libfuse2 execstack | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install Node dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: 'uv.lock' | |
| - name: Setup Python environment | |
| run: | | |
| uv python install 3.12 | |
| uv venv --python 3.12 .venv | |
| uv sync | |
| - name: Determine version | |
| id: version | |
| run: | | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| elif [[ -n "${{ inputs.version }}" ]]; then | |
| VERSION="${{ inputs.version }}" | |
| else | |
| VERSION=$(node -p "require('./package.json').version") | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Build application | |
| run: pnpm run build | |
| - name: Remove bundled PortAudio | |
| run: | | |
| # Remove bundled PortAudio so the app uses the system's libportaudio | |
| # which has PipeWire/PulseAudio backends. Ubuntu's PortAudio only has ALSA. | |
| rm -f ./dist/VoiceFlow/_internal/libportaudio* | |
| echo "Removed bundled PortAudio (will use system library at runtime)" | |
| - name: Clear executable stack flags | |
| run: | | |
| # python-build-standalone builds ship libpython with GNU_STACK RWE, | |
| # which Linux 6.8+ kernels reject. Clear the flag on all bundled .so files. | |
| find ./dist/VoiceFlow -type f -name '*.so*' -exec execstack -c {} + | |
| echo "Verifying no executable stacks remain..." | |
| BAD=$(find ./dist/VoiceFlow -type f -name '*.so*' -exec sh -c \ | |
| 'readelf -l "$1" 2>/dev/null | grep -A1 GNU_STACK | grep -q RWE && echo "$1"' _ {} \;) | |
| if [ -n "$BAD" ]; then | |
| echo "::error::Files still have executable stack: $BAD" | |
| exit 1 | |
| fi | |
| - name: Smoke test - check for missing shared libraries | |
| run: | | |
| echo "Checking for missing shared libraries..." | |
| MISSING=$(ldd ./dist/VoiceFlow/VoiceFlow 2>&1 | grep "not found" || true) | |
| if [ -n "$MISSING" ]; then | |
| echo "::error::Missing shared libraries detected:" | |
| echo "$MISSING" | |
| exit 1 | |
| fi | |
| echo "All shared libraries resolved." | |
| - name: Build Linux installers | |
| env: | |
| APPIMAGE_EXTRACT_AND_RUN: '1' | |
| run: bash installer/build-linux.sh | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-artifacts | |
| path: | | |
| dist/installer/VoiceFlow-*-linux-x86_64.tar.gz | |
| dist/installer/VoiceFlow-*-x86_64.AppImage | |
| retention-days: 3 | |
| build-windows: | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install Node dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: 'uv.lock' | |
| - name: Setup Python environment | |
| run: | | |
| uv python install 3.12 | |
| uv venv --python 3.12 .venv | |
| uv sync | |
| - name: Determine version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| elif [[ -n "${{ inputs.version }}" ]]; then | |
| VERSION="${{ inputs.version }}" | |
| else | |
| VERSION=$(node -p "require('./package.json').version") | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Build application | |
| run: pnpm run build | |
| - name: Patch installer version | |
| shell: bash | |
| run: | | |
| sed -i "s/^#define MyAppVersion \".*\"/#define MyAppVersion \"${{ steps.version.outputs.version }}\"/" installer/voiceflow.iss | |
| - name: Build Windows installer | |
| shell: cmd | |
| working-directory: installer | |
| run: build-installer.bat | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-artifacts | |
| path: dist/installer/VoiceFlowSetup-*.exe | |
| retention-days: 3 | |
| release: | |
| needs: [build-linux, build-windows] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: find artifacts -type f | sort | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: VoiceFlow ${{ github.ref_name }} | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| artifacts/**/*.exe | |
| artifacts/**/*.tar.gz | |
| artifacts/**/*.AppImage |