-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (82 loc) · 3.25 KB
/
Copy pathrpm-build.yml
File metadata and controls
96 lines (82 loc) · 3.25 KB
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
name: Build Linux Packages
on:
release:
types: [published]
env:
PKG_NAME: soslyze
DIST: el7
ARCH: noarch
jobs:
build_tarball:
name: Build source archive
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Replace version in RPM spec so correct source is downloaded when building RPM
run: sed -Ei 's/(^Version:[[:space:]]*).*/\1${{github.ref_name}}/' ${{ env.PKG_NAME }}.spec
# - name: Create source archive
# run: tar -zcvf ${{ env.PKG_NAME }}-${{ github.ref_name }}.tar.gz * --transform "s,^,${{ env.PKG_NAME }}-${{ github.ref_name }}/,"
# - name: Upload source archive as artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.PKG_NAME }}-${{ github.ref_name }}.tar.gz
# path: ${{ env.PKG_NAME }}-${{ github.ref_name }}.tar.gz
build_rpm:
name: Build .rpm package
needs: build_tarball
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Replace version in RPM spec so correct source is downloaded when building RPM
run: sed -Ei 's/(^Version:[[:space:]]*).*/\1${{github.ref_name}}/' ${{ env.PKG_NAME }}.spec
- name: Run rpmbuild on RPM spec to produce package
id: rpm
uses: naveenrajm7/rpmbuild@master
#uses: naveenrajm7/rpmbuild@centos8
with:
spec_file: ${{ env.PKG_NAME }}.spec
# additional_repos: "['centos-release-scl', 'http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm']"
- name: Upload .rpm package as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}-${{ github.ref_name }}-1.${{ env.DIST }}.${{ env.ARCH }}.rpm
path: rpmbuild/RPMS/${{ env.ARCH }}/*.rpm
build_deb:
name: Build .deb package
needs: build_rpm
runs-on: ubuntu-latest
steps:
- name: Download .rpm artifact
uses: actions/download-artifact@v4
id: download
with:
name: ${{ env.PKG_NAME }}-${{ github.ref_name }}-1.${{ env.DIST }}.${{ env.ARCH }}.rpm
- name: Convert .rpm to .deb
run: |
sudo apt install -y alien
sudo alien -k --verbose --to-deb *.rpm
- name: Upload .deb package as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}-${{ github.ref_name }}-1.${{ env.DIST }}.${{ env.ARCH }}.deb
path: ${{ env.PKG_NAME }}*.deb
release:
name: Create release with all assets
needs: [build_tarball, build_rpm, build_deb]
runs-on: ubuntu-latest
steps:
- name: Download cached rpm, deb, and tar.gz artifacts
uses: actions/download-artifact@v4
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# files: |
# ${{ env.PKG_NAME }}-${{ github.ref_name }}.tar.gz/*.tar.gz
- name: Release *.rpm and *.deb
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.PKG_NAME }}-${{ github.ref_name }}-1.${{ env.DIST }}.${{ env.ARCH }}.rpm/**/*.rpm
${{ env.PKG_NAME }}-${{ github.ref_name }}-1.${{ env.DIST }}.${{ env.ARCH }}.deb/**/*.deb