[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 04/05: ci: add debian packaging job
From: |
gnunet |
Subject: |
[gnunet] 04/05: ci: add debian packaging job |
Date: |
Wed, 11 Oct 2023 22:56:40 +0200 |
This is an automated email from the git hooks/post-receive script.
dvn pushed a commit to branch master
in repository gnunet.
commit e8d3e9dd69de86ffcceffcadc6c9b3fd68cd0724
Author: Devan Carpenter <git@dvn.me>
AuthorDate: Wed Oct 11 16:33:19 2023 -0400
ci: add debian packaging job
---
ci/Containerfile | 1 +
ci/jobs/2-deb-package/job.sh | 22 ++++++++++++++++++++++
ci/jobs/2-deb-package/version.sh | 12 ++++++++++++
3 files changed, 35 insertions(+)
diff --git a/ci/Containerfile b/ci/Containerfile
index ecab13be9..e0778e7b7 100644
--- a/ci/Containerfile
+++ b/ci/Containerfile
@@ -35,6 +35,7 @@ RUN apt-get install -yqq \
build-essential \
debhelper-compat \
devscripts \
+ git-buildpackage \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workdir
diff --git a/ci/jobs/2-deb-package/job.sh b/ci/jobs/2-deb-package/job.sh
new file mode 100755
index 000000000..fc1f114f4
--- /dev/null
+++ b/ci/jobs/2-deb-package/job.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -exuo pipefail
+# This file is in the public domain.
+# Helper script to build the latest DEB packages in the container.
+
+
+unset LD_LIBRARY_PATH
+
+# Install build-time dependencies.
+# Update apt cache first
+apt-get update
+mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes
--no-install-recommends --yes' debian/control
+
+export VERSION="$(./ci/jobs/2-deb-package/version.sh)"
+echo "Building gnunet packages version ${VERSION}"
+EMAIL=none gbp dch --ignore-branch --debian-tag="%(version)s" --git-author
--new-version="${VERSION}"
+./bootstrap
+dpkg-buildpackage -rfakeroot -b -uc -us
+
+ls -alh ../*.deb
+mkdir -p /artifacts/gnunet/${CI_COMMIT_REF} # Variable comes from CI
environment
+mv ../*.deb /artifacts/gnunet/${CI_COMMIT_REF}/
diff --git a/ci/jobs/2-deb-package/version.sh b/ci/jobs/2-deb-package/version.sh
new file mode 100755
index 000000000..74d0099a2
--- /dev/null
+++ b/ci/jobs/2-deb-package/version.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -ex
+
+git fetch origin $(git rev-parse --abbrev-ref HEAD) --depth=1000 --tags
+RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always --abbrev=0
HEAD)
+
+commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
+if [ "${commits}" = "0" ]; then
+ git describe --tag HEAD
+else
+ echo $(echo ${RECENT_VERSION_TAG} | cut -d'v' -f2)-${commits}-$(git
rev-parse --short=8 HEAD)
+fi
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.