---
# See the documentation for more information:
# https://packit.dev/docs/configuration/

upstream_tag_template: v{version}

packages:
  ramalama-fedora:
    pkg_tool: fedpkg
    downstream_package_name: ramalama
    specfile_path: rpm/ramalama.spec
  ramalama-centos:
    downstream_package_name: ramalama
    specfile_path: rpm/ramalama.spec

srpm_build_deps:
  - make

actions:
  fix-spec-file: "bash .packit-copr-rpm.sh"

jobs:
  # Copr builds for Fedora
  - job: copr_build
    trigger: pull_request
    packages: [ramalama-fedora]
    enable_net: true
    targets: &fedora_copr_targets
      - fedora-all
    osh_diff_scan_after_copr_build: false

  # Copr builds for CentOS Stream
  - job: copr_build
    trigger: pull_request
    enable_net: true
    packages: [ramalama-centos]
    targets: &centos_copr_targets
      - centos-stream-10

  # Run on commit to main branch
  - job: copr_build
    trigger: commit
    packages: [ramalama-fedora]
    enable_net: true
    branch: main
    owner: rhcontainerbot
    project: podman-next

  # Tests for Fedora
  - job: tests
    trigger: pull_request
    packages: [ramalama-fedora]
    targets: *fedora_copr_targets
    tmt_plan: "/plans/rpm"
    identifier: "rpm-fedora"

  - job: tests
    trigger: pull_request
    skip_build: true
    packages: [ramalama-fedora]
    targets:
      # FIXME: Validate test breaks on Fedora 41
      - fedora-development
      - fedora-latest-stable
    tmt_plan: "/plans/no-rpm"
    identifier: "no-rpm-fedora"
    manual_trigger: true

  # Tests for CentOS Stream
  - job: tests
    trigger: pull_request
    packages: [ramalama-centos]
    targets: *centos_copr_targets
    tmt_plan: "/plans/rpm"
    identifier: "rpm-centos"

  - job: propose_downstream
    trigger: release
    packages: [ramalama-fedora]
    dist_git_branches: &fedora_targets
      - fedora-all
      - epel10
      - epel10.0

  - job: koji_build
    trigger: commit
    packages: [ramalama-fedora]
    dist_git_branches: *fedora_targets

  - job: bodhi_update
    trigger: commit
    packages: [ramalama-fedora]
    dist_git_branches:
      - fedora-branched # rawhide updates are created automatically
      - epel10
      - epel10.0
