-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (77 loc) · 2.54 KB
/
push-copr-build.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: RPM build in Fedora Copr
on:
# Builf for push on master and pull request
pull_request:
workflow_dispatch:
inputs:
oqpython-ver:
description: Version of Python to build
default: oq-python39
required: true
git-ref:
description: Git Ref Branch
default: master
required: true
gem-project:
description: GEM COPR Project
default: openquake
required: true
jobs:
build:
name: Submit a build from Fedora container
runs-on: ubuntu-latest
env:
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_DEF_BR: ${{ github.event.repository.default_branch }}
GITHUB_REF: ${{ github.ref }}
GITHUB_HD_REF: ${{ github.head_ref }}
GITHUB_BS_REF: ${{ github.base_ref }}
strategy:
matrix:
epel-release: [epel-7-x86_64, rocky+epel-8-x86_64, rocky+epel-9-x86_64]
# Run in Fedora container on Ubuntu VM
container:
image: fedora:38
options: --privileged
steps:
- name: Clone Repository (Latest)
uses: actions/checkout@v2
if: github.event.inputs.git-ref == ''
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v2
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Install tooling for source RPM build
run: |
dnf -y install @development-tools @rpm-development-tools \
copr-cli mock make gcc openssl-devel bzip2-devel libffi-devel
- name: Build RPM from SPEC files
env:
pyver: ${{ github.event.inputs.oqpython-ver }}
run: |
mkdir -p ~/rpmbuild/{RPMS,SOURCES,SPECS,SRPMS}
echo "Python version: ${pyver}"
if [[ "$pyver" != "" ]]
then
cd ${pyver}
else
cd oq-python39
fi
cp oq-python.spec ~/rpmbuild/SPECS/
ls -lrt
spectool -g -R ~/rpmbuild/SPECS/oq-python.spec
rpmbuild -bs ~/rpmbuild/SPECS/oq-python.spec
SRPM=$(ls ~/rpmbuild/SRPMS/*.src.rpm)
mock -r ${{ matrix.epel-release}} $SRPM
- name: Publish Package on COPR
env:
API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }}
COPR_REPO: ${{ github.event.inputs.gem-project }}
run: |
mkdir -p "$HOME/.config"
echo "$API_TOKEN_CONTENT" > "$HOME/.config/copr"
echo "COPR REPO: $COPR_REPO"
SRPM=$(ls ~/rpmbuild/SRPMS/*.src.rpm)
copr-cli build ${COPR_REPO} $SRPM