-
Notifications
You must be signed in to change notification settings - Fork 10
115 lines (97 loc) · 3.36 KB
/
test-ubuntu-20.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
name: Test Ubuntu 20.04
on:
push:
jobs:
test-ubuntu-20:
container:
image: ubuntu:20.04
runs-on: ubuntu-latest
steps:
- name: Install Git
run: |
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates \
git
- name: Checkout
uses: actions/checkout@v3.5.3
with:
path: package-sources
- name: Checkout otp
uses: actions/checkout@v3.5.3
with:
repository: erlang/otp
ref: maint-25
fetch-depth: 0
path: erlang-sources
- name: Build package
run: |
set -x
if test -f /etc/debian_version; then
dist_version=debian-$(cat /etc/debian_version)
fi
export DEBIAN_FRONTEND=noninteractive
apt-get install -y tzdata
echo "Europe/London" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
apt-get install -y --no-install-recommends \
build-essential \
devscripts \
equivs \
gnupg \
rsync
apt-get install -y --no-install-recommends git-buildpackage
cd erlang-sources
cp -a ../package-sources/debian .
branch=erlang-debian-package-by-rabbitmq
version=$(git describe --tags --abbrev=10)
case "$version" in
OTP-*)
version=$(echo "$version" | \
sed -E \
-e 's/^OTP-//' \
-e 's/-/~/' \
-e 's/-/./')
;;
OTP_*)
version=$(echo "$version" | \
sed -E \
-e 's/OTP_R([1-9]+)B0*([1-9]+)($|-([0-9]+))/\1.b.\2\3/' \
-e 's/-/./')
;;
*)
exit 1
;;
esac
if test "$(git rev-parse HEAD)" = "$(git rev-parse master)"; then
# If we are on the `master` branch of Erlang, the last tag doesn't
# match the future version of Erlang. Let's construct the version from
# the `OTP_VERSION` file.
future_version=$(cat OTP_VERSION)
future_version=${future_version%-*}
version=$(echo "$version" | sed -E 's/([^~]+)/'"$future_version"'/')
fi
tag=upstream-tag-for-debian-package
git rev-parse "$tag" -- >/dev/null 2>&1 || git tag "$tag"
git checkout -b "$branch"
# Remove non-free documentation.
for fn in $(find lib/*/doc -name standard -or -name archive); do
rm -rf "$fn"
done
# --------------------------------------------------------------------
# Configure git-buildpackage.
# --------------------------------------------------------------------
cat > ~/.gbp.conf <<EOF
[DEFAULT]
upstream-tag = $tag
EOF
# --------------------------------------------------------------------
# Build package.
# --------------------------------------------------------------------
mk-build-deps -i \
-t 'apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y'
rm -f erlang-build-deps*
gbp buildpackage \
--git-ignore-new \
--git-debian-branch="$branch" \
--no-sign