-
Notifications
You must be signed in to change notification settings - Fork 24
59 lines (53 loc) · 1.85 KB
/
build-pkgs.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
name: Build Packages
on:
push:
tags: '[0-9]+.[0-9]+.[0-9]+-*'
schedule:
# If this workflow changes in the future to uploading RPMs directly to a
# release on tag push, then a conditional check should be added for the
# cron to continue uploading as an artifact on the workflow build.
- cron: '41 22 * * SUN'
jobs:
build-rpm:
runs-on: ubuntu-latest
if: '!github.event.repository.fork'
env:
# _github_home is the dir used as a volume by the container
RPMDIR: /home/runner/work/_temp/_github_home/rpmbuild
steps:
- name: Install rpmlint
run: |
sudo apt-get update
sudo apt-get install rpmlint
- uses: actions/checkout@v4
with:
# Get all branches and tags so the latest tag can be found for VERSION
fetch-depth: 0
- name: Set VERSION
run: echo "VERSION=`echo $(git describe --tags $(git rev-list --tags --max-count=1))`" >> $GITHUB_ENV
- name: Set SSMDIR
run: echo "SSMDIR=apel-ssm-$VERSION" >> $GITHUB_ENV
# Based on the ssm-build-rpm.sh script
- name: Download and rename archive
run: |
wget --no-check-certificate https://github.com/apel/ssm/archive/$VERSION.tar.gz -O $VERSION
tar xzvf $VERSION
mv ssm-$VERSION $SSMDIR
tar czvf $SSMDIR.tar.gz $SSMDIR
sudo mkdir -p $RPMDIR/SOURCES
sudo cp $SSMDIR.tar.gz $RPMDIR/SOURCES
- name: Build RPM package
id: rpm
uses: naveenrajm7/[email protected]
with:
spec_file: "apel-ssm.spec"
- name: Lint RPMs
continue-on-error: true
run: rpmlint ${{ steps.rpm.outputs.rpm_dir_path }}
- name: Upload artifact
uses: actions/[email protected]
with:
name: Binary and Source RPMs
path: |
${{ steps.rpm.outputs.rpm_dir_path }}
${{ steps.rpm.outputs.source_rpm_dir_path }}