-
-
Notifications
You must be signed in to change notification settings - Fork 18
62 lines (59 loc) · 2.19 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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:
- 'fedora:41'
- 'fedora:40'
- 'fedora:39'
include:
- distro: 'fedora:39'
pre: >-
dnf install -y sudo perl-Module-Install perl-Readonly perl-Monitoring-Plugin perl-Perl-Critic rpm-build openssh-clients
- distro: 'fedora:40'
pre: >-
dnf install -y sudo perl-Module-Install perl-Readonly perl-Monitoring-Plugin perl-Perl-Critic rpm-build openssh-clients
- distro: 'fedora:41'
pre: >-
dnf install -y sudo perl-Module-Install perl-Readonly perl-Monitoring-Plugin perl-Perl-Critic rpm-build 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 /check_updates -v ${PWD}:/check_updates ${{ matrix.distro }} \
/bin/sh -c 'sh ./prep-cmd.sh \
&& uname -a \
&& whoami \
&& pwd \
&& perl Makefile.PL \
&& make dist \
&& . ./build_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" '