release: 2.1.0-rc6 #10
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: Release | |
| # Tag a release to build + publish installers: | |
| # git tag v2.0.0 && git push origin v2.0.0 | |
| # A "-" in the tag (e.g. v2.0.0-rc1) marks it as a GitHub pre-release, which the | |
| # in-app updater surfaces to users who opted into pre-releases. | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| jobs: | |
| # Refuse to build a release whose tag disagrees with the app's own version. | |
| # autoptz.__version__ is the single source of truth; a tag like v2.1.0 must | |
| # match it, or the installers would report the wrong version to users. | |
| guard: | |
| name: Verify tag matches __version__ | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Tag must match autoptz.__version__ | |
| shell: bash | |
| run: | | |
| ver="$(sed -nE 's/^__version__ *= *"([^"]+)".*/\1/p' autoptz/__init__.py)" | |
| if [ "$GITHUB_REF_TYPE" = "tag" ]; then | |
| tag="${GITHUB_REF_NAME#v}" | |
| echo "tag=v$tag __version__=$ver" | |
| if [ "$tag" != "$ver" ]; then | |
| echo "::error::Tag v$tag does not match autoptz.__version__ ($ver). Bump autoptz/__init__.py to match before tagging." | |
| exit 1 | |
| fi | |
| echo "OK: tag matches __version__" | |
| else | |
| echo "Manual dispatch (ref_type=$GITHUB_REF_TYPE); __version__=$ver — skipping tag match." | |
| fi | |
| # Apple Silicon (arm64) — the required macOS build; gates the release. | |
| macos: | |
| name: Build macOS .dmg (arm64) | |
| needs: guard | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/macos-signed-build | |
| with: | |
| arch: arm64 | |
| cert-b64: ${{ secrets.MACOS_CERTIFICATE_P12_BASE64 }} | |
| cert-password: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | |
| sign-identity: ${{ secrets.MACOS_SIGN_IDENTITY }} | |
| notary-apple-id: ${{ secrets.MACOS_NOTARY_APPLE_ID }} | |
| notary-team-id: ${{ secrets.MACOS_NOTARY_TEAM_ID }} | |
| notary-password: ${{ secrets.MACOS_NOTARY_PASSWORD }} | |
| sign-required: "1" | |
| # Intel (x86_64) — best-effort. GitHub retired the macos-13 Intel image (Dec 2025); | |
| # `macos-15-intel` is its standard-runner replacement and the last Intel image | |
| # (x86_64 support ends ~Fall 2027). This job is deliberately NOT a dependency of | |
| # `release`, so a missing/slow Intel runner can never hold up the arm64 + Windows + | |
| # Linux release; continue-on-error keeps the run green if it fails, and the x86_64 | |
| # dmg ships whenever it finishes in time. | |
| macos-intel: | |
| name: Build macOS .dmg (x86_64, best-effort) | |
| needs: guard | |
| runs-on: macos-15-intel | |
| continue-on-error: true | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/macos-signed-build | |
| with: | |
| arch: x86_64 | |
| cert-b64: ${{ secrets.MACOS_CERTIFICATE_P12_BASE64 }} | |
| cert-password: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | |
| sign-identity: ${{ secrets.MACOS_SIGN_IDENTITY }} | |
| notary-apple-id: ${{ secrets.MACOS_NOTARY_APPLE_ID }} | |
| notary-team-id: ${{ secrets.MACOS_NOTARY_TEAM_ID }} | |
| notary-password: ${{ secrets.MACOS_NOTARY_PASSWORD }} | |
| sign-required: "1" | |
| windows: | |
| name: Build Windows installer | |
| needs: guard | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install Inno Setup | |
| run: choco install innosetup --no-progress -y | |
| - name: Build .exe + installer | |
| env: | |
| MAKE_INSTALLER: "1" | |
| run: powershell -ExecutionPolicy Bypass -File packaging\build_windows.ps1 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows | |
| path: dist/*-setup.exe | |
| if-no-files-found: error | |
| compression-level: 0 | |
| linux: | |
| name: Build Linux AppImage | |
| needs: guard | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install system libs | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| libegl1 libgl1 libxkbcommon0 libdbus-1-3 libfuse2 \ | |
| libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \ | |
| libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 | |
| - name: Build AppImage | |
| env: | |
| MAKE_APPIMAGE: "1" | |
| run: bash packaging/build_linux.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux | |
| path: dist/*.AppImage | |
| if-no-files-found: error | |
| compression-level: 0 | |
| release: | |
| name: Publish GitHub Release | |
| needs: [macos, windows, linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Publish | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/**/* | |
| generate_release_notes: true | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| fail_on_unmatched_files: true | |
| publish-macos-intel: | |
| name: Attach macOS x86_64 artifact if available | |
| needs: [release, macos-intel] | |
| if: ${{ always() && github.ref_type == 'tag' && needs.release.result == 'success' && needs.macos-intel.result == 'success' }} | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-x86_64 | |
| path: artifacts/macos-x86_64 | |
| - name: Upload x86_64 dmg to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release upload "${GITHUB_REF_NAME}" artifacts/macos-x86_64/*.dmg --clobber --repo "${GITHUB_REPOSITORY}" |