name: Build Application

on:
  push:
    branches-ignore:
      - "renovate/**"
    # NOTE: `!` doesn't work with `paths-ignore` :(
    # So we a catch-all glob instead
    # https://github.com/orgs/community/discussions/25369#discussioncomment-3247674
    paths:
      - "**"
      - "!.github/**"
      - ".github/workflows/build.yml"
      - ".github/workflows/trigger_builds.yml"
      - "!flatpak/"
      - "!nix/"
      - "!scripts/"

      - "!.git*"
      - "!.envrc"
      - "!**.md"
      - "COPYING.md"
      - "!renovate.json"
  pull_request:
    # See above
    paths:
      - "**"
      - "!.github/**"
      - ".github/workflows/build.yml"
      - ".github/workflows/trigger_builds.yml"
      - "!flatpak/"
      - "!nix/"
      - "!scripts/"

      - "!.git*"
      - "!.envrc"
      - "!**.md"
      - "COPYING.md"
      - "!renovate.json"
  workflow_dispatch:

jobs:
  build_debug:
    name: Build Debug
    uses: ./.github/workflows/build.yml
    with:
      build_type: Debug
      is_qt_cached: true
    secrets:
      SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}
      WINDOWS_CODESIGN_CERT: ${{ secrets.WINDOWS_CODESIGN_CERT }}
      WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
      APPLE_CODESIGN_CERT: ${{ secrets.APPLE_CODESIGN_CERT }}
      APPLE_CODESIGN_PASSWORD: ${{ secrets.APPLE_CODESIGN_PASSWORD }}
      APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
      APPLE_NOTARIZE_APPLE_ID: ${{ secrets.APPLE_NOTARIZE_APPLE_ID }}
      APPLE_NOTARIZE_TEAM_ID: ${{ secrets.APPLE_NOTARIZE_TEAM_ID }}
      APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }}
      GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
      GPG_PRIVATE_KEY_ID: ${{ secrets.GPG_PRIVATE_KEY_ID }}
