automate deb dist better and bump version
This commit is contained in:
parent
a49884ade8
commit
0e6ac39ee1
3 changed files with 26 additions and 25 deletions
|
@ -10,14 +10,6 @@ set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|
||||||
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
|
|
||||||
|
|
||||||
if [[ -f "$REPO_DIR/.venv/bin/activate" ]]; then
|
|
||||||
source "$REPO_DIR/.venv/bin/activate"
|
|
||||||
else
|
|
||||||
echo "[!] Warning: No virtualenv presesnt in $REPO_DIR.venv"
|
|
||||||
fi
|
|
||||||
cd "$REPO_DIR"
|
|
||||||
|
|
||||||
CURRENT_PLAFORM="$(uname)"
|
CURRENT_PLAFORM="$(uname)"
|
||||||
REQUIRED_PLATFORM="Linux"
|
REQUIRED_PLATFORM="Linux"
|
||||||
|
@ -26,19 +18,27 @@ if [[ "$CURRENT_PLAFORM" != "$REQUIRED_PLATFORM" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
|
|
||||||
DEBIAN_VERSION="1"
|
|
||||||
# make sure the stdeb.cfg file is up-to-date with all the dependencies
|
|
||||||
|
|
||||||
|
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
|
||||||
|
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
|
||||||
|
DEBIAN_VERSION="${DEBIAN_VERSION:-1}"
|
||||||
|
cd "$REPO_DIR"
|
||||||
|
|
||||||
|
|
||||||
|
if [[ -f "$REPO_DIR/.venv/bin/activate" ]]; then
|
||||||
|
source "$REPO_DIR/.venv/bin/activate"
|
||||||
|
else
|
||||||
|
echo "[!] Warning: No virtualenv presesnt in $REPO_DIR.venv"
|
||||||
|
fi
|
||||||
|
|
||||||
# cleanup build artifacts
|
# cleanup build artifacts
|
||||||
rm -Rf build deb_dist dist archivebox-*.tar.gz
|
rm -Rf build deb_dist dist archivebox-*.tar.gz
|
||||||
|
|
||||||
|
|
||||||
# build source and binary packages
|
# build source and binary packages
|
||||||
|
# make sure the stdeb.cfg file is up-to-date with all the dependencies
|
||||||
python3 setup.py --command-packages=stdeb.command \
|
python3 setup.py --command-packages=stdeb.command \
|
||||||
sdist_dsc --debian-version=$DEBIAN_VERSION \
|
sdist_dsc --debian-version=$DEBIAN_VERSION \
|
||||||
bdist_deb
|
bdist_deb
|
||||||
|
|
||||||
# push the build to launchpad ppa
|
# should output deb_dist/archivebox_0.5.4-1.{deb,changes,buildinfo,tar.gz}
|
||||||
# dput archivebox "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
|
|
||||||
|
|
|
@ -10,12 +10,6 @@ set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|
||||||
PGP_KEY_ID="${PGP_KEY_ID:-7D5695D3B618872647861D51C38137A7C1675988}"
|
|
||||||
|
|
||||||
|
|
||||||
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
|
|
||||||
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
|
|
||||||
cd "$REPO_DIR"
|
|
||||||
|
|
||||||
CURRENT_PLAFORM="$(uname)"
|
CURRENT_PLAFORM="$(uname)"
|
||||||
REQUIRED_PLATFORM="Linux"
|
REQUIRED_PLATFORM="Linux"
|
||||||
|
@ -25,16 +19,23 @@ if [[ "$CURRENT_PLAFORM" != "$REQUIRED_PLATFORM" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
[[ "$PGP_PUBLIC_KEY" ]] && echo "$PGP_PUBLIC_KEY" > /tmp/archivebox_gpg.key.pub
|
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
|
||||||
[[ "$PGP_PRIVATE_KEY" ]] && echo "$PGP_PRIVATE_KEY" > /tmp/archivebox_gpg.key
|
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
|
||||||
|
DEBIAN_VERSION="${DEBIAN_VERSION:-1}"
|
||||||
|
cd "$REPO_DIR"
|
||||||
|
|
||||||
|
|
||||||
echo "[+] Loading PGP keys from env vars and filesystem..."
|
echo "[+] Loading PGP keys from env vars and filesystem..."
|
||||||
|
# https://github.com/ArchiveBox/debian-archivebox/settings/secrets/actions
|
||||||
|
PGP_KEY_ID="${PGP_KEY_ID:-BC2D21B0D84E16C437300B8652423FBED1586F45}"
|
||||||
|
[[ "${PGP_PUBLIC_KEY:-}" ]] && echo "$PGP_PUBLIC_KEY" > /tmp/archivebox_gpg.key.pub
|
||||||
|
[[ "${PGP_PRIVATE_KEY:-}" ]] && echo "$PGP_PRIVATE_KEY" > /tmp/archivebox_gpg.key
|
||||||
gpg --import /tmp/archivebox_gpg.key.pub || true
|
gpg --import /tmp/archivebox_gpg.key.pub || true
|
||||||
gpg --import --allow-secret-key-import /tmp/archivebox_gpg.key || true
|
gpg --import --allow-secret-key-import /tmp/archivebox_gpg.key || true
|
||||||
|
echo "$PGP_KEY_ID:6:" | gpg --import-ownertrust || true
|
||||||
|
|
||||||
echo "[*] Signing build and changelog with PGP..."
|
echo "[*] Signing build and changelog with PGP..."
|
||||||
debsign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
|
debsign --re-sign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
|
||||||
|
|
||||||
# make sure you have this in ~/.dput.cf:
|
# make sure you have this in ~/.dput.cf:
|
||||||
# [archivebox-ppa]
|
# [archivebox-ppa]
|
||||||
|
@ -46,4 +47,4 @@ debsign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_sourc
|
||||||
|
|
||||||
|
|
||||||
echo "[^] Uploading to launchpad.net"
|
echo "[^] Uploading to launchpad.net"
|
||||||
dput archivebox "deb_dist/archivebox_${VERSION}-1_source.changes"
|
dput -f archivebox "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "archivebox",
|
"name": "archivebox",
|
||||||
"version": "0.5.4",
|
"version": "0.5.5",
|
||||||
"description": "ArchiveBox: The self-hosted internet archive",
|
"description": "ArchiveBox: The self-hosted internet archive",
|
||||||
"author": "Nick Sweeting <archivebox-npm@sweeting.me>",
|
"author": "Nick Sweeting <archivebox-npm@sweeting.me>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
Loading…
Reference in a new issue