forked from OpenLI-NZ/openli
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (115 loc) · 3.94 KB
/
rpm-build.yaml
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
name: Packaging for RPM
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "rockylinux:8"
- "rockylinux:9"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install prereq packages
run: ./rpmpkg-setup.sh ${{ matrix.target }}
- name: Build packages
run: ./rpmpkg-build.sh
- name: Set environment variables for upload
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Copy packages to uploadable location
run: |
mkdir -p packages/${DIRNAME}
cp ~/rpmbuild/RPMS/x86_64/*.rpm packages/${DIRNAME}/
- name: Store packages
uses: actions/upload-artifact@v4
with:
name: packages-${{ env.DIRNAME }}
path: packages/${{ env.DIRNAME }}/*.rpm
retention-days: 1
test:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "rockylinux:8"
- "rockylinux:9"
needs: build
steps:
- name: Set environment variables for download
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: packages-${{ env.DIRNAME }}
- name: Add repositories
env:
TARGET: ${{ matrix.target }}
run: |
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandio/cfg/setup/bash.rpm.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandder/cfg/setup/bash.rpm.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libtrace/cfg/setup/bash.rpm.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/openli/cfg/setup/bash.rpm.sh' | bash
curl -1sLf https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey -o packagecloud-rabbitmq-key.asc
gpg --import packagecloud-rabbitmq-key.asc
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | bash
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | bash
if [[ "${TARGET}" =~ rocky* ]]; then
dnf install -y dnf-plugins-core epel-release || true
dnf config-manager --set-enabled powertools || true
/usr/bin/crb enable || true
fi
- name: Test package install
run: |
yum install -y findutils
find . -name "*.rpm" | xargs yum install -y
- name: Test package removal
run: |
rpm -e openli-provisioner
rpm -e openli-collector
rpm -e openli-mediator
publish:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "rockylinux:8"
- "rockylinux:9"
needs: test
steps:
- name: Set environment variables for download
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: packages-${{ env.DIRNAME }}
- name: Copy packages
run: |
mkdir -p packages/${DIRNAME}
yum install -y findutils
find . -name "*.rpm" | xargs cp -t packages/${DIRNAME}/
- name: Publish package to cloudsmith
uses: salcock/[email protected]
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/openli
username: salcock
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}