-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (44 loc) · 1.39 KB
/
Daily-build.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
name: Daily build
run-name: Daily build triggered by ${{ github.actor }} 🎉
on:
workflow_dispatch:
inputs:
rpm_version:
description: "RPM version"
required: true
type: string
rpm_release:
description: "Rpm release number"
required: false
default: ''
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout workspace
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.17.1'
- name: Build rpm (x86_64)
run: |
TOP_DIR=~/rpmbuild
echo "Create rpm dirs, pwd: $(pwd), TOP_DIR=${TOP_DIR}"
rm --force --recursive --verbose ${TOP_DIR}
mkdir -p ${TOP_DIR}/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo "Start build rpm"
export PROJECT_NAME='obagent'
export VERSION=${{ inputs.rpm_version }}
rpm_release_number=$(date +%Y%m%d)
if [[ -n "${{ inputs.rpm_release }}" ]]; then rpm_release_number="${{ inputs.rpm_release }}"; fi
export RELEASE=${rpm_release_number}
echo "Build obagent rpm, VERSION=${VERSION}, RELEASE=${RELEASE}"
rpmbuild --define "_topdir ${TOP_DIR}" -bb rpm/$PROJECT_NAME.spec
- name: Upload rpm (x86_64)
uses: actions/upload-artifact@v3
with:
path: rpmbuild/obagent-*.rpm