Skip to content

Commit 0a77671

Browse files
committed
first stab at actions
1 parent 5d4e84b commit 0a77671

File tree

4 files changed

+118
-0
lines changed

4 files changed

+118
-0
lines changed

.github/workflows/packages.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Package all the things
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build_varnish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v5
15+
with:
16+
submodules: true
17+
18+
# - name: Fetch Varnish
19+
# uses: actions/checkout@v5
20+
# with:
21+
# repository: varnishcache/varnish-cache
22+
# ref: varnish-8.0.0
23+
# path: src/varnish-cache
24+
25+
- name: Download Varnish
26+
run: |
27+
mkdir src
28+
cd src
29+
curl -L https://varnish-cache.org/downloads/varnish-8.0.0.tgz | tar xvzf - --strip 1
30+
31+
- name:
32+
run: |
33+
cp -a --dereference varnish-cache/debian make-deb-packages.sh src/
34+
cd src
35+
36+
mkdir -p packages
37+
38+
EXT=deb
39+
ARCH=amd64
40+
41+
ls
42+
docker run \
43+
--rm \
44+
-it \
45+
--security-opt seccomp=unconfined \
46+
-e PARAM_DIST=debian \
47+
-e PARAM_RELEASE=bookworm \
48+
-v $(pwd):/varnish-cache \
49+
--platform linux/$ARCH \
50+
debian:bookworm \
51+
ls /varnish-cache/make-deb-packages.sh
52+
# /varnish-cache/make-$EXT-packages.sh

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "varnish-cache"]
2+
path = varnish-cache
3+
url = [email protected]:varnishcache/pkg-varnish-cache.git

make-deb-packages.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
export DEBIAN_FRONTEND=noninteractive
6+
export DEBCONF_NONINTERACTIVE_SEEN=true
7+
apt-get update
8+
apt-get install -y dpkg-dev debhelper devscripts equivs pkg-config apt-utils fakeroot
9+
10+
echo "PARAM_RELEASE: $PARAM_RELEASE"
11+
echo "PARAM_DIST: $PARAM_DIST"
12+
13+
14+
if [ -z "$PARAM_RELEASE" ]; then
15+
echo "Env variable PARAM_RELEASE is not set! For example PARAM_RELEASE=focal for Ubuntu 20.04"
16+
exit 1
17+
elif [ -z "$PARAM_DIST" ]; then
18+
echo "Env variable PARAM_DIST is not set! For example PARAM_DIST=debian"
19+
exit 1
20+
fi
21+
22+
# Ubuntu 20.04 aarch64 fails when using fakeroot-sysv with:
23+
# semop(1): encountered an error: Function not implemented
24+
update-alternatives --set fakeroot /usr/bin/fakeroot-tcp
25+
26+
cd /varnish-cache
27+
ls -la
28+
29+
echo "Untar debian..."
30+
tar xavf debian.tar.gz
31+
32+
echo "Untar orig..."
33+
tar xavf varnish-*.tar.gz --strip 1
34+
35+
echo "Update changelog version..."
36+
if [ -e .is_weekly ]; then
37+
WEEKLY='-weekly'
38+
else
39+
WEEKLY=
40+
fi
41+
VERSION=$(./configure --version | awk 'NR == 1 {print $NF}')$WEEKLY-1~$PARAM_RELEASE
42+
sed -i -e "s|@VERSION@|$VERSION|" "debian/changelog"
43+
44+
echo "Install Build-Depends packages..."
45+
yes | mk-build-deps --install debian/control || true
46+
47+
echo "Build the packages..."
48+
dpkg-buildpackage -us -uc -j16
49+
50+
echo "Prepare the packages for storage..."
51+
mkdir -p packages/$PARAM_DIST/$PARAM_RELEASE/
52+
mv ../*.deb packages/$PARAM_DIST/$PARAM_RELEASE/
53+
54+
if [ "`uname -m`" = "x86_64" ]; then
55+
ARCH="amd64"
56+
else
57+
ARCH="arm64"
58+
fi
59+
60+
DSC_FILE=$(ls ../*.dsc)
61+
DSC_FILE_WO_EXT=$(basename ${DSC_FILE%.*})
62+
mv $DSC_FILE packages/$PARAM_DIST/$PARAM_RELEASE/${DSC_FILE_WO_EXT}_${ARCH}.dsc

varnish-cache

Submodule varnish-cache added at a28bede

0 commit comments

Comments
 (0)