Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions .github/workflows/check-patch.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: Check patch
name: build

on:
push:
branches: [master]
tags: ['*']
pull_request:
branches: [master]
workflow_dispatch:
Expand Down Expand Up @@ -33,30 +34,38 @@ jobs:
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }}

steps:
- name: Checkout sources
uses: actions/checkout@v7

- name: Mark repository as safe
run: git config --global --add safe.directory "$(pwd)"

- name: checkout sources
uses: actions/checkout@v7

- name: install dnf dependencies
- name: Install dnf dependencies
run: dnf install -y autoconf automake gettext-devel git systemd make rpm-build libtool python3-pip epel-release python-devel

- name: install python dependencies
- name: Install python dependencies
run: pip install flake8 tools

- name: autogen
- name: Autogen
run: ./autogen.sh

- name: configure
run: ./configure

- name: Add git revision suffix
- name: Set build environment
run: |
SUFFIX=".$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)"
sed "s:%{?release_suffix}:${SUFFIX}:" -i engine-db-query.spec
TAG=$(git tag --points-at HEAD | head -1)
if [[ -n "$TAG" ]]; then
if [[ "$TAG" =~ -([0-9]+)$ ]]; then
echo "PACKAGE_RPM_RELEASE=${BASH_REMATCH[1]}" >> $GITHUB_ENV
else
echo "PACKAGE_RPM_RELEASE=1" >> $GITHUB_ENV
fi
else
echo "RELEASE_SUFFIX=.$(date --utc +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" >> $GITHUB_ENV
fi

- name: run distcheck
- name: Configure
run: ./configure

- name: Run distcheck
run: make -j distcheck

- name: Build RPM
Expand All @@ -68,10 +77,6 @@ jobs:
find tmp.repos -iname \*rpm -exec mv "{}" exported-artifacts/ \;
mv ./*tar.gz exported-artifacts/

- name: test install
run: |
yum --downloadonly install -y exported-artifacts/*noarch.rpm

- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@ man/Makefile
man/Makefile.in
src/bin/Makefile
src/bin/Makefile.in

# Not autogenerated!
\!.copr/Makefile

7 changes: 4 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ DISTCLEANFILES = \
DISTCLEANDIRS = autom4te.cache

TMPREPOS = tmp.repos
RPM_FLAGS := --define="_topdir `pwd`/$(TMPREPOS)"
RPMBUILD_ARGS := --define="_topdir `pwd`/$(TMPREPOS)"
RPMBUILD_ARGS += $(if $(RELEASE_SUFFIX),--define="release_suffix $(RELEASE_SUFFIX)")

rpm: srpm
rpmbuild $(RPM_FLAGS) --rebuild "$(TMPREPOS)"/SRPMS/*.src.rpm
rpmbuild $(RPMBUILD_ARGS) --rebuild "$(TMPREPOS)"/SRPMS/*.src.rpm
cp $(distdir).tar.gz $(TMPREPOS)/SOURCES/
@echo
@echo "rpm available at '$(TMPREPOS)'"
Expand All @@ -54,7 +55,7 @@ rpm: srpm
srpm: dist
rm -rf "$(TMPREPOS)"
mkdir -vp $(TMPREPOS)/{SPECS,RPMS,SRPMS,SOURCES}
rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz
rpmbuild $(RPMBUILD_ARGS) -ts $(distdir).tar.gz
@echo
@echo "srpm available at '$(TMPREPOS)'"

Expand Down
10 changes: 7 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ define([VERSION_MAJOR], [1])
define([VERSION_MINOR], [6])
define([VERSION_FIX], [6])
define([VERSION_NUMBER], VERSION_MAJOR[.]VERSION_MINOR[.]VERSION_FIX)
define([VERSION_SUFFIX], [master])

AC_INIT([engine-db-query], VERSION_NUMBER[]VERSION_SUFFIX, [devel@ovirt.org])
AC_INIT([engine-db-query], VERSION_NUMBER, [devel@ovirt.org])
PACKAGE_NAME="engine-db-query"
PACKAGE_RPM_VERSION="VERSION_NUMBER"
PACKAGE_RPM_RELEASE="0"

AC_ARG_VAR([PACKAGE_RPM_RELEASE],
[RPM release field (default: 0.master for development, release number for release builds)])
AS_IF([test -z "$PACKAGE_RPM_RELEASE"],
[PACKAGE_RPM_RELEASE="0.master"])

AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability tar-pax])

AC_SUBST([PACKAGE_RPM_VERSION])
Expand Down
3 changes: 0 additions & 3 deletions engine-db-query.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

%global modname engine_db_query

%global commit 0000000000000000000000000000000000000000
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name: @PACKAGE_NAME@
Version: @PACKAGE_RPM_VERSION@
Release: @PACKAGE_RPM_RELEASE@%{?release_suffix}%{?dist}
Expand Down