Skip to content

Commit 0e6ac39

Browse files
committed
automate deb dist better and bump version
1 parent a49884a commit 0e6ac39

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

bin/build_deb.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ set -o nounset
1010
set -o pipefail
1111
IFS=$'\n'
1212

13-
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
14-
15-
if [[ -f "$REPO_DIR/.venv/bin/activate" ]]; then
16-
source "$REPO_DIR/.venv/bin/activate"
17-
else
18-
echo "[!] Warning: No virtualenv presesnt in $REPO_DIR.venv"
19-
fi
20-
cd "$REPO_DIR"
2113

2214
CURRENT_PLAFORM="$(uname)"
2315
REQUIRED_PLATFORM="Linux"
@@ -26,19 +18,27 @@ if [[ "$CURRENT_PLAFORM" != "$REQUIRED_PLATFORM" ]]; then
2618
exit 0
2719
fi
2820

21+
22+
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
2923
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
30-
DEBIAN_VERSION="1"
31-
# make sure the stdeb.cfg file is up-to-date with all the dependencies
24+
DEBIAN_VERSION="${DEBIAN_VERSION:-1}"
25+
cd "$REPO_DIR"
3226

3327

28+
if [[ -f "$REPO_DIR/.venv/bin/activate" ]]; then
29+
source "$REPO_DIR/.venv/bin/activate"
30+
else
31+
echo "[!] Warning: No virtualenv presesnt in $REPO_DIR.venv"
32+
fi
33+
3434
# cleanup build artifacts
3535
rm -Rf build deb_dist dist archivebox-*.tar.gz
3636

3737

3838
# build source and binary packages
39+
# make sure the stdeb.cfg file is up-to-date with all the dependencies
3940
python3 setup.py --command-packages=stdeb.command \
4041
sdist_dsc --debian-version=$DEBIAN_VERSION \
4142
bdist_deb
4243

43-
# push the build to launchpad ppa
44-
# dput archivebox "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
44+
# should output deb_dist/archivebox_0.5.4-1.{deb,changes,buildinfo,tar.gz}

bin/release_deb.sh

+12-11
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ set -o nounset
1010
set -o pipefail
1111
IFS=$'\n'
1212

13-
PGP_KEY_ID="${PGP_KEY_ID:-7D5695D3B618872647861D51C38137A7C1675988}"
14-
15-
16-
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
17-
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
18-
cd "$REPO_DIR"
1913

2014
CURRENT_PLAFORM="$(uname)"
2115
REQUIRED_PLATFORM="Linux"
@@ -25,16 +19,23 @@ if [[ "$CURRENT_PLAFORM" != "$REQUIRED_PLATFORM" ]]; then
2519
fi
2620

2721

28-
[[ "$PGP_PUBLIC_KEY" ]] && echo "$PGP_PUBLIC_KEY" > /tmp/archivebox_gpg.key.pub
29-
[[ "$PGP_PRIVATE_KEY" ]] && echo "$PGP_PRIVATE_KEY" > /tmp/archivebox_gpg.key
22+
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
23+
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
24+
DEBIAN_VERSION="${DEBIAN_VERSION:-1}"
25+
cd "$REPO_DIR"
26+
3027

3128
echo "[+] Loading PGP keys from env vars and filesystem..."
29+
# https://github.com/ArchiveBox/debian-archivebox/settings/secrets/actions
30+
PGP_KEY_ID="${PGP_KEY_ID:-BC2D21B0D84E16C437300B8652423FBED1586F45}"
31+
[[ "${PGP_PUBLIC_KEY:-}" ]] && echo "$PGP_PUBLIC_KEY" > /tmp/archivebox_gpg.key.pub
32+
[[ "${PGP_PRIVATE_KEY:-}" ]] && echo "$PGP_PRIVATE_KEY" > /tmp/archivebox_gpg.key
3233
gpg --import /tmp/archivebox_gpg.key.pub || true
3334
gpg --import --allow-secret-key-import /tmp/archivebox_gpg.key || true
34-
35+
echo "$PGP_KEY_ID:6:" | gpg --import-ownertrust || true
3536

3637
echo "[*] Signing build and changelog with PGP..."
37-
debsign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
38+
debsign --re-sign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
3839

3940
# make sure you have this in ~/.dput.cf:
4041
# [archivebox-ppa]
@@ -46,4 +47,4 @@ debsign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_sourc
4647

4748

4849
echo "[^] Uploading to launchpad.net"
49-
dput archivebox "deb_dist/archivebox_${VERSION}-1_source.changes"
50+
dput -f archivebox "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "archivebox",
3-
"version": "0.5.4",
3+
"version": "0.5.5",
44
"description": "ArchiveBox: The self-hosted internet archive",
55
"author": "Nick Sweeting <[email protected]>",
66
"license": "MIT",

0 commit comments

Comments
 (0)