forked from elementary/monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.64 KB
/
release-copr.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
---
name: Release on Copr
on:
release:
types: [published]
jobs:
build:
name: Submit a build for Copr
container: fedora:latest
runs-on: ubuntu-latest
steps:
- name: Check out proper version of sources
uses: actions/checkout@v1
with:
submodules: true
- name: Install API token for copr-cli
env:
API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }}
run: |
mkdir -p "$HOME/.config"
echo "$API_TOKEN_CONTENT" > "$HOME/.config/copr"
# - name: Check spec for bumped version
# run: |
# grep -q ${{ github.event.release.tag_name }} spc.spec || { echo "Version not bumped!" && exit 1; }
- name: Install tooling for source RPM build
run: |
dnf -y install @development-tools @rpm-development-tools
dnf -y install copr-cli
- name: Archive the source
run: |
git archive --prefix "monitor/" -o "monitor.tar" HEAD
git submodule foreach --recursive "git archive --prefix=monitor/\$path/ --output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/monitor.tar \$sha1.tar && rm \$sha1.tar"
gzip "monitor.tar"
- name: Build the source RPM
run: |
rm -f *.src.rpm ; \
rpmbuild \
--define "_sourcedir `pwd`" \
--define "_rpmdir `pwd`" \
--define "_builddir `pwd`" \
--define "_specdir `pwd`" \
--define "_srcrpmdir `pwd`" \
-bs *.spec
- name: Submit the build by uploading the source RPM
run: copr build stsdc/monitor *.src.rpm