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
35 changes: 35 additions & 0 deletions .github/workflows/rpm-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build RPMS

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-rpms:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Creating mock gpg directory
run: mkdir -p ~/.gnupg

- name: Pull Container Images
run: |
sudo ln -sf /usr/bin/podman /usr/bin/docker
podman pull ghcr.io/cloudox-org/cloudox-rpm-builder-test-alma:8
podman pull ghcr.io/cloudox-org/cloudox-rpm-builder-test-alma:9
podman pull ghcr.io/cloudox-org/cloudox-rpm-builder-test-alma:10

- name: Building RPMS
run: make all
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

VERSION ?= 10
PACKAGE = prometheus3
IMAGE = cloudox-rpm-builder-alma:${VERSION}
REGISTRY = ghcr.io/cloudox-org/cloudox-rpm-builder-test-alma
IMAGE = ${REGISTRY}:${VERSION}
OUT_DIR = el${VERSION}

all:
Expand All @@ -13,16 +14,16 @@ all:
build:
mkdir -p ${OUT_DIR}

podman run -ti --rm -v ${PWD}:/root/rpmbuild/SOURCES:z \
podman run --rm -v ${PWD}:/root/rpmbuild/SOURCES:z \
-v ${PWD}/${OUT_DIR}:/root/rpmbuild/RPMS/x86_64:z \
-v ${PWD}/${OUT_DIR}:/root/rpmbuild/RPMS/noarch:z \
-v ${HOME}/.gnupg:/root/.gnupg:z \
${IMAGE} \
build-spec /root/rpmbuild/SOURCES/${PACKAGE}.spec

podman run -ti --rm -v ${PWD}/${OUT_DIR}:/var/tmp/:z \
podman run --rm -v ${PWD}/${OUT_DIR}:/var/tmp/:z \
${IMAGE} \
/bin/bash -c '/usr/bin/dnf install --verbose -y --setopt=localpkg_gpgcheck=1 /var/tmp/${PACKAGE}*.rpm'
/bin/bash -c '/usr/bin/dnf install --verbose -y /var/tmp/${PACKAGE}*.rpm'

@echo "[*] Removing sources..."
@rm -f *.tar.gz
Expand Down
Loading