-
Notifications
You must be signed in to change notification settings - Fork 8
159 lines (152 loc) · 4.79 KB
/
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
# When a tag is created
# - create a new release from the tag
# - build and attach packages to the release
name: Create packages and release
on:
push:
tags:
- "v*"
jobs:
build-centos7:
name: Build centOS 7 RPMs
runs-on: ubuntu-latest
container: quay.io/centos/centos:7
steps:
# XXX: Checkout v4 do not work on RHEL 7
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install build requisites
run: |
yum install -y rpm-build make rsync
- name: build rpm
run: |
make clean rpm
- name: Upload RPMs
uses: actions/upload-artifact@v3
with:
name: rpms7
path: |
build/RPMS/noarch/bdii-*.el7.noarch.rpm
build/SRPMS/bdii-*.el7.src.rpm
build-almalinux8:
name: Build AlmaLinux 8 RPMs
runs-on: ubuntu-latest
container: almalinux:8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build requisites
run: |
yum install -y rpm-build make rsync
- name: build rpm
run: |
make clean rpm
- name: Upload RPMs
uses: actions/upload-artifact@v3
with:
name: rpms8
path: |
build/RPMS/noarch/bdii-*.el8.noarch.rpm
build/SRPMS/bdii-*.el8.src.rpm
build-almalinux9:
name: Build AlmaLinux 9 RPMs
runs-on: ubuntu-latest
container: almalinux:9
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build requisites
run: |
yum install -y rpm-build make rsync systemd-rpm-macros
- name: build rpm
run: |
make clean rpm
- name: Upload RPMs
uses: actions/upload-artifact@v3
with:
name: rpms9
path: |
build/RPMS/noarch/bdii-*.el9.noarch.rpm
build/SRPMS/bdii-*.el9.src.rpm
release7:
name: Upload CentOS 7 release artefacts
permissions:
contents: write # to upload release asset (softprops/action-gh-release)
needs: build-centos7
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: rpms7
- name: Find package name
id: package_name_centos7
run: |
rpm_path=$(find . -name 'bdii-*.el7.noarch.rpm')
src_path=$(find . -name 'bdii-*.el7.src.rpm')
echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT"
echo "src_path=${src_path}" >> "$GITHUB_OUTPUT"
- name: Attach CentOS 7 RPMs to the release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
files: |
${{ steps.package_name_centos7.outputs.rpm_path }}
${{ steps.package_name_centos7.outputs.src_path }}
release8:
name: Upload AlmaLinux 8 release artefacts
permissions:
contents: write # to upload release asset (softprops/action-gh-release)
needs: build-almalinux8
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: rpms8
- name: Find package name
id: package_name_almalinux8
run: |
rpm_path=$(find . -name 'bdii-*.el8.noarch.rpm')
src_path=$(find . -name 'bdii-*.el8.src.rpm')
echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT"
echo "src_path=${src_path}" >> "$GITHUB_OUTPUT"
- name: Attach AlmaLinux 8 RPMs to the release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
files: |
${{ steps.package_name_almalinux8.outputs.rpm_path }}
${{ steps.package_name_almalinux8.outputs.src_path }}
release9:
name: Upload AlmaLinux 9 release artefacts
permissions:
contents: write # to upload release asset (softprops/action-gh-release)
needs: build-almalinux9
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: rpms9
- name: Find package name
id: package_name_almalinux9
run: |
rpm_path=$(find . -name 'bdii-*.el9.noarch.rpm')
src_path=$(find . -name 'bdii-*.el9.src.rpm')
echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT"
echo "src_path=${src_path}" >> "$GITHUB_OUTPUT"
- name: Attach AlmaLinux 9 RPMs to the release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
files: |
${{ steps.package_name_almalinux9.outputs.rpm_path }}
${{ steps.package_name_almalinux9.outputs.src_path }}