Debian Codegraph @

.github/workflows/pkgbuild.yml

raw
1 #
2 # Verify on CI/GHA that RPM package building works.
3 #
4 name: RPM Packaging
5
6 on:
7 # master - v1.x branch
8 # apprise-v2-release - v2.x branch
9 push:
10 branches: [main, master, apprise-v1-release, 'release/**']
11 pull_request:
12 branches: [main, master, apprise-v1-release]
13 workflow_dispatch:
14
15 jobs:
16
17 build:
18 name: Build RPMs (${{ matrix.dist }})
19 runs-on: ubuntu-latest
20
21 strategy:
22 fail-fast: false
23 matrix:
24 dist: [el9, el10]
25
26 container:
27 image: ghcr.io/caronc/apprise-rpmbuild:${{ matrix.dist }}
28 options: --user root
29
30 steps:
31 - name: Checkout source
32 uses: actions/checkout@v7
33
34 - name: Build RPMs
35 run: ./bin/build-rpm.sh
36 env:
37 APPRISE_DIR: ${{ github.workspace }}
38 # Drop RPMs into dist/<dist> inside the workspace
39 DIST_DIR: ${{ github.workspace }}/dist/${{ matrix.dist }}
40
41 - name: Show RPMs found for upload
42 run: |
43 echo "Listing dist/${{ matrix.dist }}/**/*.rpm:"
44 find dist/${{ matrix.dist }} -type f -name '*.rpm'
45
46 - name: Upload RPM Artifacts
47 uses: actions/upload-artifact@v7
48 with:
49 name: built-rpms-${{ matrix.dist }}
50 path: ./dist/${{ matrix.dist }}
51 if-no-files-found: error
52 retention-days: 5
53
54 - name: Upload rpmlint config files
55 uses: actions/upload-artifact@v7
56 with:
57 # Upload the specific files needed for verification
58 name: rpmlint-config-${{ matrix.dist }}
59 path: ./packaging/redhat/python-apprise.rpmlintrc.${{ matrix.dist }}
60 retention-days: 5
61
62 verify:
63 name: Verify RPMs (${{ matrix.dist }})
64 needs: build
65 runs-on: ubuntu-latest
66
67 strategy:
68 fail-fast: false
69 matrix:
70 dist: [el9, el10]
71
72 container:
73 image: ghcr.io/caronc/apprise-rpmbuild:${{ matrix.dist }}
74 options: --user root
75
76 steps:
77 - name: Download built RPMs
78 uses: actions/download-artifact@v8
79 with:
80 name: built-rpms-${{ matrix.dist }}
81 path: ./dist
82
83 - name: Download rpmlint config files
84 uses: actions/download-artifact@v8
85 with:
86 name: rpmlint-config-${{ matrix.dist }}
87 # Download files directly into the correct directory
88 path: ./packaging/redhat
89
90 - name: Lint RPMs
91 run: |
92 set -e
93 RC_FILE="./packaging/redhat/python-apprise.rpmlintrc.${{ matrix.dist }}"
94
95 if rpmlint --help 2>&1 | grep -q -- '--rpmlintrc'; then
96 echo "Using rpmlint --rpmlintrc with $RC_FILE"
97 rpmlint --rpmlintrc "$RC_FILE" ./dist/**/*.rpm
98 else
99 echo "Using rpmlint v1.x on older distribution"
100 rpmlint -f "$RC_FILE" ./dist/**/*.rpm
101 fi
102
103 - name: Install and verify RPMs
104 run: |
105 echo "Installing RPMs from: ./dist/"
106 find ./dist -name '*.rpm'
107 dnf install -y ./dist/**/*.rpm
108 apprise --version
109
110 - name: Check Installed Files
111 run: rpm -qlp ./dist/**/*.rpm