# See the documentation for more information:
# https://packit.dev/docs/configuration/
upstream_project_url: https://github.com/martinpitt/umockdev
issue_repository: https://github.com/martinpitt/umockdev
copy_upstream_release_description: true
upstream_package_name: umockdev
downstream_package_name: umockdev

actions:
  create-archive:
    - meson tmp/dist
    # ignore local spec changes from packit
    - meson dist -C tmp/dist --no-tests --allow-dirty
    - sh -ec 'mv tmp/dist/meson-dist/umockdev-*.tar.xz packaging/; ls packaging/umockdev-*.tar.xz'

srpm_build_deps:
  - meson
  - gcc
  - vala
  - libpcap-devel
  - glib2-devel
  - systemd-devel

packages:
  umockdev-fedora:
    specfile_path: packaging/umockdev.spec
  umockdev-centos:
    specfile_path: packaging/umockdev.spec
    pkg_tool: centpkg

jobs:
  - job: copr_build
    trigger: pull_request
    packages: [umockdev-fedora]
    targets:
      - fedora-development-x86_64
      - fedora-development-i386
      - fedora-development-aarch64
      - fedora-development-ppc64le
      - fedora-development-s390x
      # needed for tests
      - fedora-latest

  - job: copr_build
    trigger: pull_request
    packages: [umockdev-centos]
    targets:
      - centos-stream-9-x86_64
      - centos-stream-10-x86_64

  - job: tests
    trigger: pull_request
    packages: [umockdev-fedora]
    targets:
      - fedora-latest

  - job: tests
    trigger: pull_request
    packages: [umockdev-centos]
    targets:
      - centos-stream-9-x86_64
      - centos-stream-10-x86_64

  - job: propose_downstream
    trigger: release
    packages: [umockdev-fedora]
    dist_git_branches:
      - fedora-development
      - fedora-stable

  - job: propose_downstream
    trigger: release
    packages: [umockdev-centos]
    dist_git_branches:
      - c9s
      - c10s

  - job: koji_build
    trigger: commit
    packages: [umockdev-fedora]
    dist_git_branches:
      - fedora-all

  - job: bodhi_update
    trigger: commit
    packages: [umockdev-fedora]
    dist_git_branches:
      # rawhide updates are created automatically
      - fedora-branched
