diff options
Diffstat (limited to 'contrib/ci/jobs/2-deb-package')
-rwxr-xr-x | contrib/ci/jobs/2-deb-package/job.sh | 22 | ||||
-rwxr-xr-x | contrib/ci/jobs/2-deb-package/version.sh | 12 |
2 files changed, 34 insertions, 0 deletions
diff --git a/contrib/ci/jobs/2-deb-package/job.sh b/contrib/ci/jobs/2-deb-package/job.sh new file mode 100755 index 000000000..fc1f114f4 --- /dev/null +++ b/contrib/ci/jobs/2-deb-package/job.sh | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/bin/bash | ||
2 | set -exuo pipefail | ||
3 | # This file is in the public domain. | ||
4 | # Helper script to build the latest DEB packages in the container. | ||
5 | |||
6 | |||
7 | unset LD_LIBRARY_PATH | ||
8 | |||
9 | # Install build-time dependencies. | ||
10 | # Update apt cache first | ||
11 | apt-get update | ||
12 | mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control | ||
13 | |||
14 | export VERSION="$(./ci/jobs/2-deb-package/version.sh)" | ||
15 | echo "Building gnunet packages version ${VERSION}" | ||
16 | EMAIL=none gbp dch --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}" | ||
17 | ./bootstrap | ||
18 | dpkg-buildpackage -rfakeroot -b -uc -us | ||
19 | |||
20 | ls -alh ../*.deb | ||
21 | mkdir -p /artifacts/gnunet/${CI_COMMIT_REF} # Variable comes from CI environment | ||
22 | mv ../*.deb /artifacts/gnunet/${CI_COMMIT_REF}/ | ||
diff --git a/contrib/ci/jobs/2-deb-package/version.sh b/contrib/ci/jobs/2-deb-package/version.sh new file mode 100755 index 000000000..74d0099a2 --- /dev/null +++ b/contrib/ci/jobs/2-deb-package/version.sh | |||
@@ -0,0 +1,12 @@ | |||
1 | #!/bin/sh | ||
2 | set -ex | ||
3 | |||
4 | git fetch origin $(git rev-parse --abbrev-ref HEAD) --depth=1000 --tags | ||
5 | RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0 HEAD) | ||
6 | |||
7 | commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)" | ||
8 | if [ "${commits}" = "0" ]; then | ||
9 | git describe --tag HEAD | ||
10 | else | ||
11 | echo $(echo ${RECENT_VERSION_TAG} | cut -d'v' -f2)-${commits}-$(git rev-parse --short=8 HEAD) | ||
12 | fi | ||