Skip to content

Publish RPM

Publish RPM #20

Workflow file for this run

name: Publish RPM
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
linux:
# The host should always be linux
runs-on: ubuntu-latest
name: Building RPMs on ${{ matrix.distro }}
strategy:
fail-fast: false
matrix:
distro:
- 'centos:7'
- 'fedora:40'
- 'fedora:39'
include:
- distro: 'fedora:40'
pre: >-
dnf install -y autoconf automake rpm-build make gcc bison flex pandoc openssh-clients
- distro: 'fedora:39'
pre: >-
dnf install -y autoconf automake rpm-build make gcc bison flex pandoc openssh-clients
- distro: 'centos:7'
pre: >-
yum -y install epel-release &&
yum install -y --enablerepo=epel autoconf automake rpm-build make gcc bison flex pandoc openssh-clients
steps:
- name: Git clone repository
uses: actions/checkout@v3
with:
submodules: true
- name: Build the RPM on ${{ matrix.distro }}
env:
PRE: ${{ matrix.pre }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
echo $PRE > ./prep-cmd.sh
echo "${SSH_PRIVATE_KEY}" > id_rsa
docker run --network host -w /roll -v ${PWD}:/roll ${{ matrix.distro }} \
/bin/sh -c 'sh ./prep-cmd.sh \
&& uname -a \
&& whoami \
&& pwd \
&& ./regen.sh \
&& ./configure \
&& . ./utils/prepare_rpm.sh \
&& echo "$RPM --> $RPMDIR" \
&& echo "$SRPM --> $SRPMDIR" \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh \
&& cp id_rsa /root/.ssh \
&& chmod 600 /root/.ssh/id_rsa \
&& scp -oStrictHostKeyChecking=no $RPM github@rpm.corti.li:$RPMDIR \
&& scp -oStrictHostKeyChecking=no $SRPM github@rpm.corti.li:$SRPMDIR \
&& echo "Updating /var/www/rpm/$DIST/$RELEASE" \
&& ssh -oStrictHostKeyChecking=no github@rpm.corti.li "createrepo /var/www/rpm/$DIST/$RELEASE" '