name: build # The three downloads, in one place. release.yml calls this one rather than # holding a copy of it, and a pull request that touches the packaging runs it # on its own, because the alternative is finding out that a build is broken # from the release that was supposed to publish it. on: workflow_call: inputs: ref: description: what to check out; the caller's own ref when empty type: string required: false default: "" version: description: write this version into the tree before building type: string required: false default: "" pull_request: paths: - packaging/** - .github/workflows/build.yml - dikte/integrate.py - dikte/trayicon.py workflow_dispatch: permissions: contents: read jobs: build: strategy: fail-fast: false matrix: include: # The oldest Ubuntu still offered, because the glibc a build links # against is the oldest one it will run on, and 22.04's covers every # distribution released since. Move it up only when it goes away. - os: ubuntu-22.04 kind: appimage - os: macos-latest kind: dmg # Intel Macs. This runner is the last x86_64 image Actions will # offer, and it goes away in August 2027. - os: macos-15-intel kind: dmg # x64 only, which is what the PyQt6 wheel and whisper.cpp both # publish for Windows; a machine on ARM runs the result emulated, # the same way it runs everything else that was never built for it. - os: windows-latest kind: windows runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} - uses: actions/setup-python@v5 with: python-version: "3.12" # PyQt6 ships Qt itself, but Qt still loads these from the system, and # the build draws its own icon before it packages anything. - name: Install the Qt runtime libraries if: runner.os == 'Linux' timeout-minutes: 5 run: | apt="-o Acquire::Retries=3 -o Acquire::http::Timeout=20" sudo apt-get $apt update sudo apt-get $apt install --no-install-recommends -y \ libegl1 libgl1 libxkbcommon0 libdbus-1-3 libglib2.0-0 \ libfontconfig1 libfreetype6 libgssapi-krb5-2 - name: Install PyQt6 and PyInstaller run: python -m pip install --quiet PyQt6 pyinstaller # Only for the builds off master: a tagged build already says the number # it was tagged with, and rewriting it would be rewriting the tag. - name: Write the version being built if: inputs.version # Named, because the Windows runner's own shell is PowerShell and this # is a here-document. shell: bash env: VERSION: ${{ inputs.version }} run: | python - <<'PY' import os, pathlib, re path = pathlib.Path("dikte/__init__.py") path.write_text(re.sub(r'^__version__ = ".*"$', f'__version__ = "{os.environ["VERSION"]}"', path.read_text(), flags=re.M)) PY - name: Build if: runner.os != 'Windows' run: ./packaging/build-${{ matrix.kind }}.sh # The same steps as the other two, in the language the platform already # has: drawing the icon, PyInstaller, and wrapping the result in what # people download. - name: Build if: runner.os == 'Windows' shell: pwsh run: ./packaging/build-${{ matrix.kind }}.ps1 - uses: actions/upload-artifact@v4 with: name: dikte-${{ matrix.os }} path: dist/* if-no-files-found: error