-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release: integrate debian build/publish steps directly in this reposi…
…tory as scripts in tools/packaging/debian
- Loading branch information
1 parent
71405dc
commit 6126c95
Showing
14 changed files
with
137 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gpg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
FROM debian:bookworm | ||
FROM ubuntu:23.10 | ||
|
||
# Build dependencies | ||
RUN apt update \ | ||
&& apt install -y \ | ||
RUN apt update | ||
|
||
# Packaging essentials | ||
RUN apt install -y \ | ||
gpg \ | ||
curl \ | ||
build-essential \ | ||
devscripts \ | ||
debhelper \ | ||
&& apt clean | ||
|
||
# Symly build dependencies | ||
RUN apt install -y \ | ||
openjdk-17-jdk-headless \ | ||
ant \ | ||
libpicocli-java \ | ||
&& apt clean | ||
|
||
VOLUME /workspace | ||
WORKDIR /workspace | ||
|
||
ENV DEBEMAIL='loic@loicrouchon.com' | ||
ENV DEBFULLNAME='Loic Rouchon' | ||
ENV PPA_URL='ppa:loicrouchon/symly' | ||
ENV GPG_KEY_FINGERPRINT='C3BB9448B16C971103E876BF3A091A0DF2799262' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Debian packaging | ||
|
||
## Tooling | ||
|
||
```shell | ||
make build-env | ||
``` | ||
|
||
### Packaging & publication | ||
|
||
```shell | ||
VERSION=xxx make build publish | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env sh | ||
set -ex | ||
|
||
cur_dir="$(dirname "$(realpath "$0")")" | ||
. "${cur_dir}/common.sh" | ||
|
||
echo "Building debian source package ${package_version_dir}" | ||
|
||
rm -rf "${target_dir}" | ||
mkdir -p "${target_dir}" | ||
cd "${target_dir}" || exit 1 | ||
|
||
echo "Downloading upstream tarball from ${upstream_tarball_url}" | ||
curl -sL "${upstream_tarball_url}" -o "${upstream_tarball}" | ||
|
||
echo "Unpacking upstream tarball ${upstream_tarball}" | ||
tar xzf "${upstream_tarball}" | ||
|
||
echo "Repacking upstream tarball ${upstream_tarball} (get rid off root level directory)" | ||
rm -f "${upstream_tarball}" | ||
tar czf "${upstream_tarball}" "${package_version_dir}" | ||
|
||
echo "Add debian dir" | ||
cd "${package_version_dir}" || exit 1 | ||
cp -R "${cur_dir}/debian" "debian" | ||
|
||
echo "Build source and binary package package" | ||
pwd | ||
# Building the deb for 'all' arch first | ||
dpkg-buildpackage --sign-key="${GPG_KEY_FINGERPRINT}" --build=all | ||
# Building the source package after so thAT THE .changes does not reference the binary package for upload via dput | ||
dpkg-buildpackage --sign-key="${GPG_KEY_FINGERPRINT}" --build=source | ||
|
||
display_artifacts | ||
test_package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env sh | ||
set -ex | ||
|
||
package_name="symly" | ||
version="$1" | ||
if [ "${version}" = "" ]; then | ||
echo "Missing version argument" | ||
exit 1 | ||
fi | ||
|
||
if ! (cat "${cur_dir}/debian/changelog" | grep -E "^${package_name} " | head -n 1 | grep -q "${package_name} (${version}-"); then | ||
echo "Package ${package_name} does not have a changelog entry for version ${version}" | ||
exit 1 | ||
fi | ||
|
||
target_dir="${cur_dir}/target/${package_name}" | ||
package_version_dir="${package_name}-${version}" | ||
package_version_name="${package_name}_${version}" | ||
upstream_tarball="${package_name}_${version}.orig.tar.gz" | ||
upstream_tarball_url="https://github.com/loicrouchon/symly/archive/refs/tags/v${version}.tar.gz" | ||
|
||
cat "${cur_dir}/gpg/"*.key | gpg --import | ||
|
||
display_artifacts() { | ||
ls -l "${target_dir}" | ||
echo ".dsc content:" | ||
cat "${target_dir}/${package_version_name}-"*.dsc | ||
echo ".buildinfo content:" | ||
cat "${target_dir}/${package_version_name}-"*.buildinfo | ||
echo ".changes content:" | ||
cat "${target_dir}/${package_version_name}-"*.changes | ||
} | ||
|
||
test_package() { | ||
apt install -y "${target_dir}/${package_version_name}-"*_all.deb | ||
version_command_output="$(symly --version)" | ||
if ! (echo "${version_command_output}" | grep -Eq "^Symly version ${version}"); then | ||
echo "ERR: Failed to test 'symly --version' | ||
ERR: Expecting: Symly version ${version} | ||
ERR: But got: ${version_command_output}" | ||
exit 1 | ||
else | ||
echo "test successful: ${version_command_output}" | ||
fi | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env sh | ||
set -ex | ||
|
||
cur_dir="$(dirname "$(realpath "$0")")" | ||
. "${cur_dir}/common.sh" | ||
|
||
display_artifacts | ||
test_package | ||
|
||
echo "Publishing debian source package ${package_version_dir} to ${PPA_URL}" | ||
dput "${PPA_URL}" "${target_dir}/${package_version_name}-"*_source.changes |