forked from syslog-ng/syslog-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.46 KB
/
create-packages.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
name: Create package from source tarball
on:
workflow_call:
inputs:
source-tarball-artifact-name:
required: true
type: string
dbld-image-mode:
required: true
type: string # cache / build
distros:
required: false
type: string
default: '[
"debian-testing",
"debian-sid",
"debian-bullseye",
"debian-bookworm",
"ubuntu-focal",
"ubuntu-jammy",
"ubuntu-noble",
"ubuntu-lunar",
"ubuntu-mantic",
"almalinux-8",
"almalinux-9",
"centos-stream9",
"fedora-latest",
"fedora-rawhide"
]'
jobs:
create-packages:
name: ${{ matrix.distro }}
runs-on: ubuntu-latest
strategy:
matrix:
distro: ${{ fromJson(inputs.distros) }}
fail-fast: false
steps:
- name: Download source tarball artifact
uses: actions/[email protected]
with:
name: ${{ inputs.source-tarball-artifact-name }}
- name: Extract source tarball
run: |
mkdir syslog-ng
tar --strip-components=1 -xvf syslog-ng*.tar.gz -C syslog-ng
- name: Prepare docker image
working-directory: syslog-ng
run: |
if [[ "${{ inputs.dbld-image-mode }}" = "build" ]]
then
./dbld/rules image-${{ matrix.distro }}
elif [[ "${{ inputs.dbld-image-mode }}" = "cache" ]]
then
./dbld/rules cache-image-${{ matrix.distro }}
else
echo Unexpected input: dbld-image-mode=${{ inputs.dbld-image-mode }}
false
fi
- name: Create package
working-directory: syslog-ng
run: |
./dbld/rules package-${{ matrix.distro }}
- name: Prepare package for artifact
# We want to keep the directory structure starting with ${{ matrix.distro }},
# but it can only be done, if we give its parent directory as `path` to upload-artifact.
# There are other directories in dbld/build which we do not want to upload,
# so let's make a temporary directory and move the ${{ matrix.distro }} directory there.
run: |
mkdir package
cp -r syslog-ng/dbld/build/${{ matrix.distro }} package/
- name: Store package as artifact
uses: actions/[email protected]
with:
name: package-${{ matrix.distro }}
path: package/*