Skip to content

Commit 66fb5b2

Browse files
committed
move debsign to release not build
1 parent 08161a5 commit 66fb5b2

File tree

3 files changed

+33
-13
lines changed

3 files changed

+33
-13
lines changed

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ graft archivebox
22
global-exclude .DS_Store
33
global-exclude __pycache__
44
global-exclude *.pyc
5+
6+
prune tests/

bin/build_deb.sh

+1-12
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,17 @@ fi
2828

2929
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
3030
DEBIAN_VERSION="1"
31-
PGP_KEY_ID="7D5695D3B618872647861D51C38137A7C1675988"
32-
# make sure you have this in ~/.dput.cf:
33-
# [archivebox-ppa]
34-
# fqdn: ppa.launchpad.net
35-
# method: ftp
36-
# incoming: ~archivebox/ubuntu/archivebox/
37-
# login: anonymous
38-
# allow_unsigned_uploads: 0
31+
# make sure the stdeb.cfg file is up-to-date with all the dependencies
3932

4033

4134
# cleanup build artifacts
4235
rm -Rf build deb_dist dist archivebox-*.tar.gz
4336

44-
# make sure the stdeb.cfg file is up-to-date with all the dependencies
4537

4638
# build source and binary packages
4739
python3 setup.py --command-packages=stdeb.command \
4840
sdist_dsc --debian-version=$DEBIAN_VERSION \
4941
bdist_deb
5042

51-
# sign the build with your PGP key ID
52-
debsign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
53-
5443
# push the build to launchpad ppa
5544
# dput archivebox "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"

bin/release_deb.sh

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

13+
PGP_KEY_ID="${PGP_KEY_ID:-7D5695D3B618872647861D51C38137A7C1675988}"
14+
15+
1316
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
1417
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
15-
SHORT_VERSION="$(echo "$VERSION" | perl -pe 's/(\d+)\.(\d+)\.(\d+)/$1.$2/g')"
1618
cd "$REPO_DIR"
1719

20+
CURRENT_PLAFORM="$(uname)"
21+
REQUIRED_PLATFORM="Linux"
22+
if [[ "$CURRENT_PLAFORM" != "$REQUIRED_PLATFORM" ]]; then
23+
echo "[!] Skipping the Debian package build on $CURRENT_PLAFORM (it can only be run on $REQUIRED_PLATFORM)."
24+
exit 0
25+
fi
26+
27+
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
30+
31+
echo "[+] Loading PGP keys from env vars and filesystem..."
32+
gpg --import /tmp/archivebox_gpg.key.pub || true
33+
gpg --import --allow-secret-key-import /tmp/archivebox_gpg.key || true
34+
35+
36+
echo "[*] Signing build and changelog with PGP..."
37+
debsign -k "$PGP_KEY_ID" "deb_dist/archivebox_${VERSION}-${DEBIAN_VERSION}_source.changes"
38+
39+
# make sure you have this in ~/.dput.cf:
40+
# [archivebox-ppa]
41+
# fqdn: ppa.launchpad.net
42+
# method: ftp
43+
# incoming: ~archivebox/ubuntu/archivebox/
44+
# login: anonymous
45+
# allow_unsigned_uploads: 0
46+
1847

1948
echo "[^] Uploading to launchpad.net"
2049
dput archivebox "deb_dist/archivebox_${VERSION}-1_source.changes"

0 commit comments

Comments
 (0)