Skip to content

Commit bc4c53f

Browse files
committed
Little enhancements to the ppa release script
1 parent 6b60524 commit bc4c53f

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/commit_hash.txt
22
/prerelease.txt
33

4+
# Auth config for ppa release
5+
/.release_ppa_auth
6+
47
# Compiled Object files
58
*.slo
69
*.lo

scripts/release_ppa.sh

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
## If the given branch is "release", the resulting package will be uploaded to
1010
## ethereum/ethereum PPA, or ethereum/ethereum-dev PPA otherwise.
1111
##
12-
## The gnupg key for "builds@ethereum.org" has to be present in order to sign
13-
## the package.
14-
##
1512
## It will clone the Solidity git from github, determine the version,
1613
## create a source archive and push it to the ubuntu ppa servers.
1714
##
18-
## This requires the following entries in /etc/dput.cf:
15+
## To interact with launchpad, you need to set the variables $LAUNCHPAD_EMAIL
16+
## and $LAUNCHPAD_KEYID in the file $PROJECTROOT/.release_ppa_auth to your launchpad email and pgp keyid.
17+
## This could for example look like this:
18+
##
19+
## LAUNCHPAD_EMAIL=your-launchpad-email@ethereum.org
20+
## LAUNCHPAD_KEYID=123ABCFFFFFFFF
21+
##
22+
## Additionally the following entries in /etc/dput.cf are required:
1923
##
2024
## [ethereum-dev]
2125
## fqdn = ppa.launchpad.net
@@ -34,11 +38,10 @@
3438
## method = ftp
3539
## incoming = ~ethereum/ethereum-static
3640
## login = anonymous
37-
3841
##
3942
##############################################################################
4043

41-
set -ev
44+
set -e
4245

4346
if [ -z "$1" ]
4447
then
@@ -51,17 +54,43 @@ is_release() {
5154
[[ "${branch}" =~ ^v[0-9]+(\.[0-9]+)*$ ]]
5255
}
5356

54-
keyid=379F4801D622CDCF
55-
email=builds@ethereum.org
57+
# source keyid and email from .release_ppa_auth
58+
if [ -e .release_ppa_auth ]
59+
then
60+
# shellcheck source=/dev/null
61+
source .release_ppa_auth
62+
fi
63+
64+
if [ -z "$LAUNCHPAD_KEYID" ] || [ -z "$LAUNCHPAD_EMAIL" ]
65+
then
66+
echo "Error: Couldn't find variables \$LAUNCHPAD_KEYID or \$LAUNCHPAD_EMAIL in sourced file .release_ppa_auth (check top comment in $0 for more information)."
67+
exit 2
68+
fi
69+
5670
packagename=solc
5771

58-
static_build_distribution=impish
72+
# This needs to be a still active release
73+
static_build_distribution=focal
5974

60-
DISTRIBUTIONS="focal impish jammy kinetic"
75+
DISTRIBUTIONS="focal jammy kinetic"
76+
77+
checkDputEntries () {
78+
if ! grep "${1}" /etc/dput.cf -q; then
79+
echo "Error: Missing ${1} section in /etc/dput.cf (check top comment in ${0} for more information)."
80+
exit 1
81+
fi
82+
}
6183

6284
if is_release
6385
then
6486
DISTRIBUTIONS="$DISTRIBUTIONS STATIC"
87+
88+
# Sanity checks
89+
checkDputEntries "\[ethereum\]"
90+
checkDputEntries "\[ethereum-static\]"
91+
else
92+
# Sanity check
93+
checkDputEntries "\[ethereum-dev\]"
6594
fi
6695

6796
for distribution in $DISTRIBUTIONS
@@ -245,7 +274,7 @@ chmod +x debian/rules
245274

246275
versionsuffix=0ubuntu1~${distribution}
247276
# bump version / add entry to changelog
248-
EMAIL="$email" dch -v "1:${debversion}-${versionsuffix}" "git build of ${commithash}"
277+
EMAIL="$LAUNCHPAD_EMAIL" dch -v "1:${debversion}-${versionsuffix}" "git build of ${commithash}"
249278

250279

251280
# build source package
@@ -287,7 +316,7 @@ fi
287316
)
288317

289318
# sign the package
290-
debsign --re-sign -k "${keyid}" "../${packagename}_${debversion}-${versionsuffix}_source.changes"
319+
debsign --re-sign -k "${LAUNCHPAD_KEYID}" "../${packagename}_${debversion}-${versionsuffix}_source.changes"
291320

292321
# upload
293322
dput "${pparepo}" "../${packagename}_${debversion}-${versionsuffix}_source.changes"

0 commit comments

Comments
 (0)