Skip to content
Merged
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
7 changes: 4 additions & 3 deletions .automation/build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ dnf builddep -y rpmbuild/SRPMS/*src.rpm

# Build binary package
rpmbuild \
--define "_topmdir rpmbuild" \
--define "_rpmdir rpmbuild" \
--rebuild rpmbuild/SRPMS/*src.rpm
--define "_topdir ${PWD}/rpmbuild" \
--define "_rpmdir ${PWD}/rpmbuild" \
--define "release_suffix ${RELEASE_SUFFIX:-}" \
--rebuild ${PWD}/rpmbuild/SRPMS/*src.rpm

# Move RPMs to exported artifacts
[[ -d $ARTIFACTS_DIR ]] || mkdir -p $ARTIFACTS_DIR
Expand Down
3 changes: 2 additions & 1 deletion .automation/build-srpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ ARTIFACTS_DIR=${1:-exported-artifacts}
[[ -d rpmbuild ]] || mkdir -p rpmbuild

rpmbuild \
-D "_topdir rpmbuild" \
-D "_topdir ${PWD}/rpmbuild" \
-D "release_suffix ${RELEASE_SUFFIX:-}" \
-ts ${TARBALL}
17 changes: 9 additions & 8 deletions .automation/generate-setup-files.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/bin/sh -e

VERSION="4.6.4"
MILESTONE=master
# MILESTONE=
RPM_RELEASE="0.1.$MILESTONE.$(date -u +%Y%m%d%H%M%S)"
# RPM_RELEASE=1
# Default version - can be overridden via RPM_VERSION env var
DEFAULT_VERSION="4.6.4"

PACKAGE_NAME="python-ovirt-engine-sdk4"

RPM_VERSION=${VERSION}
PACKAGE_VERSION=${VERSION}
[ -n "${MILESTONE}" ] && PACKAGE_VERSION+="_${MILESTONE}"
# Use RPM_VERSION from environment if set (e.g., from git tag), otherwise use default
RPM_VERSION="${RPM_VERSION:-${DEFAULT_VERSION}}"

# Use PACKAGE_RPM_RELEASE from environment if set (e.g., from git tag), otherwise default
RPM_RELEASE="${PACKAGE_RPM_RELEASE:-0.master}"

PACKAGE_VERSION="${RPM_VERSION}"

GENERATED_FILES="
lib/ovirtsdk4/version.py
Expand Down
8 changes: 0 additions & 8 deletions .copr/Makefile

This file was deleted.

91 changes: 50 additions & 41 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
name: build

on:
push:
branches: [main]
tags: ['*']
pull_request:
branches: [main]
workflow_dispatch:
Expand All @@ -14,20 +17,26 @@ env:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: almalinux-9
shortcut: el9
container-name: almalinux9
- name: almalinux-10
shortcut: el10
container-name: almalinux10
- name: centos-stream-9
shortcut: c9s
shortcut: el9s
container-name: el9stream
pip-command: pip3
- name: centos-stream-10
shortcut: c10s
shortcut: el10s
container-name: el10stream
pip-command: pip3

name: ${{ matrix.name }}
name: Build on ${{ matrix.name }}

env:
ARTIFACTS_DIR: exported-artifacts
Expand All @@ -36,55 +45,55 @@ jobs:
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }}

steps:
- name: Prepare build environment
run: |
# Install oVirt repositories
dnf copr enable -y ovirt/ovirt-master-snapshot ${{ matrix.name }}
dnf install -y ovirt-release-master
- name: Checkout sources
uses: actions/checkout@v7

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

- name: Install required packages
run: |
dnf install \
createrepo_c \
dnf-utils \
dnf install -y \
gcc \
git \
gzip \
openssl-devel \
libcurl-devel \
libxml2-devel \
libxslt-devel \
python3-devel \
python3-pip \
python3-pycurl \
python3-pygments \
python3-wheel \
rpm-build \
tar \
-y
sed

- name: Checkout sources
uses: ovirt/checkout-action@main

- name: Run build for version
- name: Set build environment
run: |
.automation/build-rpm.sh $ARTIFACTS_DIR
TAG=$(git tag --points-at HEAD | head -1)
if [[ -n "$TAG" ]]; then
if [[ "$TAG" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-([0-9]+)$ ]]; then
echo "RPM_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
echo "PACKAGE_RPM_RELEASE=${BASH_REMATCH[2]}" >> $GITHUB_ENV
elif [[ "$TAG" =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "RPM_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
echo "PACKAGE_RPM_RELEASE=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: Create DNF repository
run: |
createrepo_c $ARTIFACTS_DIR
- name: Build RPM
run: .automation/build-rpm.sh $ARTIFACTS_DIR

- name: Upload RPM artifacts
uses: ovirt/upload-rpms-action@main
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
directory: ${{ env.ARTIFACTS_DIR }}
name: rpm-${{ matrix.shortcut }}
path: ${{ env.ARTIFACTS_DIR }}

- name: Checkout target repository
if: ${{ matrix.shortcut == 'c9s' }}
uses: actions/checkout@v4
with:
path: ovirt-engine-sdk
ref: 'gh-pages'
publish-rpms:
permissions:
artifact-metadata: read
needs: build
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: ovirt/ovirt-workflows/.github/workflows/publish-rpms.yml@main
secrets: inherit

generate_documentation:
runs-on: ubuntu-latest
Expand All @@ -108,7 +117,7 @@ jobs:
libgnutls28-dev

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

- name: Install Python-SDK with Python 3
# This step installs the python-sdk with python2.7, as the extension of pdoc,
Expand Down
48 changes: 39 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,42 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: almalinux-9
shortcut: el9
container-name: almalinux9
python-packages:
- gcc
- libxml2-devel
- python3
- python3-pip
- python3-devel
- python3-setuptools
- python3.11
- python3.11-pip
- python3.11-devel
- python3.12
- python3.12-pip
- python3.12-devel
- name: almalinux-10
shortcut: el10
container-name: almalinux10
python-packages:
- gcc
- libxml2-devel
- python3
- python3-pip
- python3-devel
- python3-setuptools
- name: centos-stream-9
shortcut: c9s
shortcut: el9s
container-name: el9stream
packages:
python-packages:
- gcc
- libxml2-devel
- python3
Expand All @@ -26,34 +55,35 @@ jobs:
- python3.11
- python3.11-pip
- python3.11-devel
- python3.11-setuptools
- python3.12
- python3.12-pip
- python3.12-devel
- python3.12-setuptools
- name: centos-stream-10
shortcut: c10s
shortcut: el10s
container-name: el10stream
packages:
python-packages:
- gcc
- libxml2-devel
- python3
- python3-pip
- python3-devel
- python3-setuptools

name: ${{ matrix.name }}
name: Test on ${{ matrix.name }}

container:
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }}

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

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

- name: Install dependencies
run: |
dnf install -y ${{ join(matrix.packages, ' ') }}
dnf install -y ${{ join(matrix.python-packages, ' ') }}
python3 -m venv /venv
source /venv/bin/activate
python3 -m pip install tox
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tox]
envlist = py39, py311, py312, py313, flake8
skip_missing_interpreters = true

[testenv]
usedevelop = True
Expand Down
Loading