-
Notifications
You must be signed in to change notification settings - Fork 2
203 lines (184 loc) · 5.72 KB
/
packages.yml
File metadata and controls
203 lines (184 loc) · 5.72 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
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
name: Package all the things
on:
workflow_dispatch:
push:
branches:
- '**'
jobs:
build_varnish:
name: Varnish ${{ matrix.target }} ${{ matrix.arch }}
runs-on: ubuntu-24.04${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
arch:
- ""
# - "-arm"
target:
- debian-bullseye-deb
# - debian-bookworm-deb
# - debian-trixie-deb
# - ubuntu-jammy-deb
# - ubuntu-noble-deb
# - ubuntu-plucky-deb
# - almalinux-8-rpm
- almalinux-9-rpm
# - almalinux-10-rpm
# - amazonlinux-2023-rpm
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Build Varnish packages
run: |
if [ -z "${{ matrix.arch }}" ]; then
PARAM_ARCH=x86_64
else
PARAM_ARCH=aarch64
fi
PARAM_DIST=`echo ${{ matrix.target}} | cut -d- -f 1`
PARAM_RELEASE=`echo ${{ matrix.target }} | cut -d- -f 2`
EXT=`echo ${{ matrix.target }} | cut -d- -f 3`
cp pkg.env varnish/
docker run \
--rm \
--security-opt seccomp=unconfined \
--workdir /workdir/varnish \
-v$(pwd):/workdir \
-e PDIR=/workdir/packages/ \
$PARAM_DIST:$PARAM_RELEASE \
/workdir/build_scripts/make-$EXT-packages.sh
tree packages
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: varnish-${{ matrix.target }}${{ matrix.arch }}
path: packages
build_vmod:
needs: build_varnish
runs-on: ubuntu-24.04${{ matrix.arch }}
name: ${{ matrix.package }} ${{ matrix.target }} ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
arch:
- ""
# - "-arm"
target:
- debian-bullseye-deb
# - debian-bookworm-deb
# - debian-trixie-deb
# - ubuntu-jammy-deb
# - ubuntu-noble-deb
# - ubuntu-plucky-deb
# - almalinux-8-rpm
- almalinux-9-rpm
# - almalinux-10-rpm
# - amazonlinux-2023-rpm
package:
- varnish-modules
- vmod-uuid
- vmod-cfg
- vmod-digest
- vmod-fileserver
- vmod-geoip2
- vmod-jq
- vmod-querystring
- vmod-redis
- vmod-reqwest
- vmod-rers
exclude:
# no mhash-devel
- target: almalinux-10-rpm
package: vmod-digest
- target: amazonlinux-2023-rpm
package: vmod-digest
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
submodules: true
- name: Download a specific artifact
uses: actions/download-artifact@v4
with:
name: varnish-${{ matrix.target }}${{ matrix.arch }}
path: packages
- name: Build
run: |
tree $(pwd)/packages
PACKAGE=${{ matrix.package }}
if [ -z "${{ matrix.arch }}" ]; then
PARAM_ARCH=x86_64
else
PARAM_ARCH=aarch64
fi
PARAM_DIST=`echo ${{ matrix.target}} | cut -d- -f 1`
PARAM_RELEASE=`echo ${{ matrix.target }} | cut -d- -f 2`
EXT=`echo ${{ matrix.target }} | cut -d- -f 3`
cp pkg.env $PACKAGE/
docker run \
--rm \
-e PDIR=new_packages/ \
--workdir /workdir/$PACKAGE \
-v$(pwd):/workdir \
-v$(pwd)/packages:/deps \
-v$(pwd)/new_packages:/new_packages \
$PARAM_DIST:$PARAM_RELEASE \
/workdir/build_scripts/make-$EXT-packages.sh
tree new_packages
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}-${{ matrix.target }}${{ matrix.arch }}
path: new_packages
collect_all_packages:
name: Collect all packages
needs: [build_varnish, build_vmod]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: downloaded-artifacts
- name: Reorganize packages (strip first subdirectory)
run: |
mkdir -p all-packages
# For each artifact directory, copy its contents while preserving structure
for artifact_dir in downloaded-artifacts/*/; do
if [ -d "$artifact_dir" ]; then
cp -r "$artifact_dir"* all-packages/ 2>/dev/null || true
fi
done
# - name: Sign
# run: |
# for f in $(find packages -type f); do
# fname=$(basename $f)
# dname=$(dirname $f)
# sum=$(sha256sum $f | awk '{print $1}')
#
# mkdir -p signed/$dname
# # we don't sign dsc files
# if [ "${f##*.}" = "dsc" ]; then
# cp "$f" signed/$f
# continue
# fi
#
# curl \
# -v \
# --http1.1 \
# --show-error \
# --fail \
# --data-binary @$f \
# --header "content-sha256: $sum" \
# --header "filename: $fname" \
# --header "key: ${{ secrets.PKGSIGN_KEY }}" \
# -u "${{ secrets.PKGSIGN_USER }}:${{ secrets.PKGSIGN_PASS}}" \
# -o signed/$f "${{ secrets.PKGSIGN_URL }}"
# done
- name: Display collected packages
run: |
ls -lhR all-packages/
- name: Upload all packages as single artifact
uses: actions/upload-artifact@v4
with:
name: signed-packages
path: all-packages/