diff --git a/.packit.sh b/.packit.sh new file mode 100644 index 0000000000..f60deacd7b --- /dev/null +++ b/.packit.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Packit's default fix-spec-file often doesn't fetch version string correctly. +# This script handles any custom processing of the dist-git spec file and gets used by the +# fix-spec-file action in .packit.yaml + +set -eo pipefail + +dnf -y install git-archive-all + +# Get Version from HEAD +HEAD_VERSION=$(./build-aux/git-version-gen --prefix "" . | cut -d"-" -f1) + +# Generate source tarball +git-archive-all --prefix=crun-$HEAD_VERSION/ --force-submodules crun-$HEAD_VERSION.tar.gz + +# RPM Spec modifications + +# Fix Version +sed -i "s/^Version:.*/Version: $HEAD_VERSION/" crun.spec + +# Fix Release +sed -i "s/^Release:.*/Release: $PACKIT_RPMSPEC_RELEASE%{?dist}/" crun.spec + +# Fix Source0 +sed -i "s/^Source0:.*/Source0: %{name}-$HEAD_VERSION.tar.gz/" crun.spec + +# Fix autosetup +sed -i "s/^%autosetup.*/%autosetup -Sgit -n %{name}-$HEAD_VERSION/" crun.spec diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000000..a89a2a793c --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,41 @@ +--- +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +# Build targets can be found at: +# https://copr.fedorainfracloud.org/coprs/rhcontainerbot/packit-builds/ + +specfile_path: rpm/crun.spec +upstream_tag_template: v{version} + +jobs: + - &copr + job: copr_build + trigger: pull_request + owner: rhcontainerbot + project: packit-builds + enable_net: true + srpm_build_deps: + - make + + - <<: *copr + # Run on commit to main branch + trigger: commit + branch: main + project: podman-next + + - job: propose_downstream + trigger: release + update_release: false + dist_git_branches: + - fedora-all + + - job: koji_build + trigger: commit + dist_git_branches: + - fedora-all + + - job: bodhi_update + trigger: commit + dist_git_branches: + - fedora-branched # rawhide updates are created automatically