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
117 changes: 117 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
name: Release

on:
push:
tags:
- "v*.*"

permissions:
contents: write

jobs:
sources:
runs-on: ubuntu-latest
outputs:
RIFT_VERSION: ${{ steps.version.outputs.RIFT_VERSION }}

steps:
- uses: actions/checkout@v4

- name: Install rpm
run: |
sudo apt -y install rpm

- id: version
name: Set version variable
run: |
_VERSION=${{ github.ref_name }}
# Trim leading v prefix from tag
echo RIFT_VERSION="${_VERSION:1}" >> "$GITHUB_OUTPUT"

- name: Build source tarball
run: |
mkdir -p ~/rpmbuild/SOURCES
git archive --prefix=rift-${{ steps.version.outputs.RIFT_VERSION }}/ \
--format=tar.gz ${{ github.ref_name }} \
--output ~/rpmbuild/SOURCES/rift-${{ steps.version.outputs.RIFT_VERSION }}.tar.gz

- name: Build source RPM
run: |
rpmbuild -v \
--define "ci_version ${{ steps.version.outputs.RIFT_VERSION }}" \
-bs rift.spec

- name: Upload SRPM artifact
uses: actions/upload-artifact@v4
with:
name: srpm
path: ~/rpmbuild/SRPMS/*

packages:
needs: sources
strategy:
# Disable automatic cancellation of other running jobs as soon as one
# failure occurs in the matrix.
fail-fast: false
matrix:
buildenv:
- almalinux-8-x86_64
- almalinux-9-x86_64
- fedora-43-x86_64
runs-on: ubuntu-latest
container:
image: fedora:latest
# Option --privileged is required for mock+podman on fedora
options: --privileged

steps:
- uses: actions/checkout@v4

- name: Download SRPM artifact
uses: actions/download-artifact@v4
with:
name: srpm
path: ~/rpmbuild/SRPMS

- name: Install mock
run: |
dnf install -y mock

- name: Build binary RPM
run: |
mock --verbose --root ${{ matrix.buildenv }} \
--define "ci_version ${{ needs.sources.outputs.RIFT_VERSION }}" \
--resultdir ~/rpmbuild/RPMS \
~/rpmbuild/SRPMS/rift*.src.rpm

- name: Upload RPM artifact
uses: actions/upload-artifact@v4
with:
name: rpm-${{ matrix.buildenv }}
path: ~/rpmbuild/RPMS/*.noarch.rpm

release:
needs: packages
runs-on: ubuntu-latest

steps:
- name: Download SRPM artifacts
uses: actions/download-artifact@v4
with:
name: srpm
path: ~/rpmbuild/SRPMS

- name: Download RPMs artifacts
uses: actions/download-artifact@v4
with:
pattern: rpm-*
path: ~/rpmbuild/RPMS
merge-multiple: true

- name: Create release
uses: softprops/[email protected]
with:
files: |
/home/runner/rpmbuild/SRPMS/*.src.rpm
/home/runner/rpmbuild/RPMS/*.rpm
62 changes: 62 additions & 0 deletions rift.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
%{?python_enable_dependency_generator}

%define version %{?ci_version}%{!?ci_version:$(python3 -c "from lib.rift import __version__; print(__version__)")}

Name: rift
Version: %{version}
Release: 1%{?dist}

License: CeCILL-C
Source: https://github.com/cea-hpc/rift/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
URL: https://github.com/cea-hpc/rift

BuildRequires: python3-devel
BuildRequires: python3-setuptools
Summary: Tool to build and maintain your own RPM based repository
BuildArch: noarch
Requires: createrepo_c
Requires: genisoimage
Requires: lftp
Requires: openssh-clients
Requires: python3-boto3
Requires: python3-dnf
Requires: python3-jinja2
Requires: python3-PyYAML
Requires: python3-requests
Requires: python3-rpm
Requires: qemu
Requires: qemu-img
Requires: qemu-user
Requires: qemu-virtiofsd
Requires: rpmlint
Requires: rpm-sign

%description
Rift is a tool to manage RPM packages development effectively during their
complete lifecycle. It provides commands to perform the following actions:

* Creating new packages, either from scratch or imported from existing sources.
* Maintain and updates packages in YUM/DNF repositories.
* Launch and report automatic advanced integration and functional tests
performed in sandboxed virtual machines for more isolation and more
flexibility in the tests environments.

%prep
%autosetup

%build
%py3_build

%install
%py3_install

%files
%license Licence_CeCILL-C_V1-en.txt
%doc README.md
%doc AUTHORS
%doc Changelog
%{_bindir}/rift
%{python3_sitelib}/
%{_datadir}/%{name}

%changelog