add packaging setup with stdeb for debian and apt

vendor the base32_crockford lib
add build script for debain packages
This commit is contained in:
Nick Sweeting 2020-11-23 16:52:15 -05:00
parent f05ae7043f
commit 83693a5c03
13 changed files with 263 additions and 19 deletions

View file

@ -16,6 +16,7 @@ cd "$REPO_DIR"
./bin/build_docs.sh
./bin/build_pip.sh
./bin/build_deb.sh
./bin/build_docker.sh
echo "[√] Done. Install the built package by running:"

42
bin/build_deb.sh Executable file
View file

@ -0,0 +1,42 @@
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
IFS=$'\n'
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
source "$REPO_DIR/.venv/bin/activate"
cd "$REPO_DIR"
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
DEBIAN_VERSION="1"
PGP_KEY_ID="7D5695D3B618872647861D51C38137A7C1675988"
# make sure you have this in ~/.dput.cf:
# [archivebox-ppa]
# fqdn: ppa.launchpad.net
# method: ftp
# incoming: ~archivebox/ubuntu/archivebox/
# login: anonymous
# allow_unsigned_uploads: 0
# cleanup build artifacts
rm -Rf build deb_dist dist archivebox-*.tar.gz
# build source and binary packages
python3 setup.py --command-packages=stdeb.command \
sdist_dsc --debian-version=$DEBIAN_VERSION \
bdist_deb
# sign the build with your PGP key ID
debsign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
# push the build to launchpad ppa
# dput archivebox "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"

View file

@ -42,6 +42,7 @@ echo "${contents}" > package.json
# Build docs, python package, and docker image
./bin/build_docs.sh
./bin/build_pip.sh
./bin/build_deb.sh
./bin/build_docker.sh
@ -64,11 +65,14 @@ python3 -m twine upload --repository testpypi dist/*
echo "[^] Uploading to pypi.org"
python3 -m twine upload --repository pypi dist/*
echo "[^] Uploading to launchpad.net"
python3 -m dput archivebox "deb_dist/archivebox_${NEW_VERSION}-1_source.changes"
echo "[^] Uploading docker image"
# docker login --username=nikisweeting
# docker login docker.pkg.github.com --username=pirate
docker push docker.io/nikisweeting/archivebox
docker push docker.io/archivebox/archivebox
docker push docker.pkg.github.com/pirate/archivebox/archivebox
docker push docker.pkg.github.com/archivebox/archivebox/archivebox
echo "[√] Done. Published version v$NEW_VERSION"