forked from warewulf/warewulf
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (74 loc) · 2.16 KB
/
tagged-release.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
name: tagged-release
on:
push:
tags:
- 'v*.*.*'
jobs:
dist:
name: Checkout code and build warewulf.spec and dist
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build spec and dist
run: |
make warewulf.spec dist
- name: Upload spec and dist
uses: actions/upload-artifact@v4
with:
name: spec-and-dist
path: |
warewulf.spec
warewulf-*.tar.gz
- name: Attach dist to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
delete_file: "warewulf-*.tar.gz;warewulf-*.rpm"
file: warewulf-*.tar.gz
tags: true
rpm:
name: Build RPMs
needs: dist
runs-on: ubuntu-latest
container:
image: rockylinux/rockylinux:9
options: --privileged
strategy:
fail-fast: false
matrix:
include:
- target: rocky+epel-8-x86_64
arch: x86_64
dist: el8
- target: rocky+epel-9-x86_64
arch: x86_64
dist: el9
- target: opensuse-leap-15.5-x86_64
arch: x86_64
dist: suse.lp155
steps:
- name: Prepare mock and rpm-build
run: |
dnf -y install epel-release
dnf -y install mock rpm-build
echo "config_opts['print_main_output'] = True" >>/etc/mock/site-defaults.cfg
- name: Download dist and spec
uses: actions/download-artifact@v4
with:
name: spec-and-dist
- name: Build RPMs and run tests
run: |
mock -r ${{ matrix.target }} --rebuild --spec=warewulf.spec --sources=. \
&& mock -r ${{ matrix.target }} --chroot -- bash -c "make -C /builddir/build/BUILD/warewulf-*/ test"
- name: Attach RPM and SRPM to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "/var/lib/mock/${{ matrix.target }}/result/warewulf-*.rpm"
tags: true