-
Notifications
You must be signed in to change notification settings - Fork 283
311 lines (273 loc) · 11.7 KB
/
perl-openwsman.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
name: perl-openwsman
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
paths:
- "dependencies/perl-openwsman/**"
push:
branches:
- develop
- master
paths:
- "dependencies/perl-openwsman/**"
jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
package:
needs: [get-environment]
strategy:
fail-fast: false
matrix:
include:
- image: packaging-plugins-alma8
distrib: el8
package_extension: rpm
runner: ubuntu-22.04
arch: amd64
version: 2.7.2
- image: packaging-plugins-alma9
distrib: el9
package_extension: rpm
runner: ubuntu-22.04
arch: amd64
version: 2.7.2
- image: packaging-plugins-bullseye
distrib: bullseye
package_extension: deb
runner: ubuntu-22.04
arch: amd64
version: 2.7.2
- image: packaging-plugins-bullseye-arm64
distrib: bullseye
package_extension: deb
runner: ["self-hosted", "collect-arm64"]
arch: arm64
version: 2.7.2
runs-on: ${{ matrix.runner }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install locally sblim-sfcc
run: |
if [ "${{ matrix.distrib }}" = "bullseye" ]; then
apt-get update
apt-get install -y libcurl4-openssl-dev
cd /tmp
wget -O - https://github.com/kkaempf/sblim-sfcc/archive/refs/tags/SFCC_2_2_8.tar.gz|tar zxvf -
cd sblim-sfcc-SFCC_2_2_8
./autoconfiscate.sh
./configure --prefix=/usr
make
make install
else
dnf install -y 'dnf-command(config-manager)'
if [ "${{ matrix.distrib }}" = "el8" ]; then
dnf config-manager --set-enabled powertools
else
dnf config-manager --set-enabled crb
fi
dnf install -y sblim-sfcc-devel
fi
shell: bash
- name: Build openwsman
run: |
if [ "${{ matrix.distrib }}" = "bullseye" ]; then
apt-get install -y cmake libssl-dev libpam-dev swig libxml2-dev
else
dnf install -y wget cmake gcc-c++ libcurl-devel pam-devel swig libxml2-devel openssl-devel
fi
cd /tmp
wget -O - https://github.com/Openwsman/openwsman/archive/refs/tags/v${{ matrix.version }}.tar.gz|tar zxvf -
cd openwsman-${{ matrix.version }}/
mkdir build
cd build
cmake .. -DBUILD_PYTHON=No -DBUILD_PYTHON3=No -DBUILD_JAVA=No -DBUILD_RUBY=No -DBUILD_PERL=Yes
make
- name: Set package name and paths according to distrib
run: |
if [ "${{ matrix.distrib }}" = "bullseye" ]; then
NAME_PERL="libopenwsman-perl"
USRLIB="/usr/lib/"
if [ "${{ matrix.arch }}" = "amd64" ]; then
PERL_VENDORARCH="/usr/lib/x86_64-linux-gnu/perl5/5.32"
else
PERL_VENDORARCH="/usr/lib/aarch64-linux-gnu/perl5/5.32"
fi
else
NAME_PERL="openwsman-perl"
USRLIB="/usr/lib64/"
if [ "${{ matrix.distrib }}" = "el8" ]; then
PERL_VENDORARCH="/usr/local/lib64/perl5"
else
PERL_VENDORARCH="/usr/local/lib64/perl5/5.32"
fi
fi
sed -i "s/@VERSION@/${{ matrix.version }}/g" dependencies/perl-openwsman/libwsman.yaml
sed -i "s#@USRLIB@#$USRLIB#g" dependencies/perl-openwsman/libwsman.yaml
sed -i "s/@NAME@/$NAME_PERL/g" dependencies/perl-openwsman/perl-openwsman.yaml
sed -i "s/@VERSION@/${{ matrix.version }}/g" dependencies/perl-openwsman/perl-openwsman.yaml
sed -i "s#@PERL_VENDORARCH@#$PERL_VENDORARCH#g" dependencies/perl-openwsman/perl-openwsman.yaml
cat dependencies/perl-openwsman/sblim-sfcc.yaml
cat dependencies/perl-openwsman/libwsman.yaml
cat dependencies/perl-openwsman/perl-openwsman.yaml
shell: bash
- name: Package sblim-sfcc
if: ${{ matrix.distrib == 'bullseye' }}
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "dependencies/perl-openwsman/sblim-sfcc.yaml"
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-sblim-sfcc-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
- name: Package libwsman
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "dependencies/perl-openwsman/libwsman.yaml"
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-libwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
- name: Package perl-openwsman
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "dependencies/perl-openwsman/perl-openwsman.yaml"
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-perl-openwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@v3
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension}}
retention-days: 1
deliver-rpm:
needs: [get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [el8, el9]
name: Deliver ${{ matrix.distrib }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Delivery libwsman
uses: ./.github/actions/rpm-delivery
with:
module_name: libwsman-amd64
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: cache-${{ github.sha }}-rpm-libwsman-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
stability: ${{ needs.get-environment.outputs.stability }}
- name: Delivery perl-openwsman
uses: ./.github/actions/rpm-delivery
with:
module_name: perl-openwsman-amd64
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: cache-${{ github.sha }}-rpm-perl-openwsman-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
stability: ${{ needs.get-environment.outputs.stability }}
deliver-deb:
needs: [get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
include:
- distrib: bullseye
arch: amd64
- distrib: bullseye
arch: arm64
name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Delivery sblim-sfcc
uses: ./.github/actions/deb-delivery
with:
module_name: sblim-sfcc-${{ matrix.arch }}
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: cache-${{ github.sha }}-deb-sblim-sfcc-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
stability: ${{ needs.get-environment.outputs.stability }}
- name: Delivery libwsman
uses: ./.github/actions/deb-delivery
with:
module_name: libwsman-${{ matrix.arch }}
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: cache-${{ github.sha }}-deb-libwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
stability: ${{ needs.get-environment.outputs.stability }}
- name: Delivery perl-openwsman
uses: ./.github/actions/deb-delivery
with:
module_name: perl-openwsman-${{ matrix.arch }}
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: cache-${{ github.sha }}-deb-perl-openwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
stability: ${{ needs.get-environment.outputs.stability }}
promote:
needs: [get-environment]
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
include:
- distrib: el8
arch: amd64
- distrib: el9
arch: amd64
- distrib: bullseye
arch: amd64
- distrib: bullseye
arch: arm64
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Promote sblim-sfcc ${{ matrix.distrib }} ${{ matrix.arch }} to stable
if: ${{ matrix.distrib == 'bullseye' }}
uses: ./.github/actions/promote-to-stable
with:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
module: sblim-sfcc-${{ matrix.arch }}
distrib: ${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
- name: Promote libwsman ${{ matrix.distrib }} ${{ matrix.arch }} to stable
uses: ./.github/actions/promote-to-stable
with:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
module: libwsman-${{ matrix.arch }}
distrib: ${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
- name: Promote perl-openwsman ${{ matrix.distrib }} ${{ matrix.arch }} to stable
uses: ./.github/actions/promote-to-stable
with:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
module: perl-openwsman-${{ matrix.arch }}
distrib: ${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}