forked from andrea-manzi/emi-wn
-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (132 loc) · 4.33 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
---
# 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:
centos7:
name: Build centOS 7 RPMs
runs-on: ubuntu-latest
container: quay.io/centos/centos:7
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install build requisites
run: |
yum install -y rpm-build rpmlint make rsync
- name: build rpm
run: |
make rpm
rpmlint --file .rpmlint.ini build/RPMS/x86_64/*.rpm
- name: Upload rpms
uses: actions/upload-artifact@v3
with:
name: rpms7
path: |
build/RPMS/x86_64/wn-*.el7.x86_64.rpm
build/SRPMS/wn-*.el7.src.rpm
build-almalinux:
strategy:
matrix:
almalinux-version: [8, 9]
name: Build AlmaLinux ${{ matrix.almalinux-version }} RPMs
runs-on: ubuntu-latest
container: almalinux:${{ matrix.almalinux-version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build requisites
run: |
dnf install -y rpm-build make rsync systemd-rpm-macros
- name: build rpm
run: |
make clean rpm
- name: Upload RPMs
uses: actions/upload-artifact@v4
with:
name: rpms${{ matrix.almalinux-version }}
path: |
build/RPMS/x86_64/wn-*.el${{ matrix.almalinux-version }}.x86_64.rpm
build/SRPMS/wn-*.el${{ matrix.almalinux-version }}.src.rpm
release7:
name: Upload CentOS 7 release artefacts
needs: 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 'wn-*.el7.x86_64.rpm')
src_path=$(find . -name 'wn-*.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@v1
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-almalinux
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: rpms8
- name: Find package name
id: package_name_almalinux8
run: |
rpm_path=$(find . -name 'wn-*.el8.x86_64.rpm')
src_path=$(find . -name 'wn-*.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-almalinux
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: rpms9
- name: Find package name
id: package_name_almalinux9
run: |
rpm_path=$(find . -name 'wn-*.el9.x86_64.rpm')
src_path=$(find . -name 'wn-*.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 }}