Skip to content

Commit 51e2259

Browse files
authored
Merge pull request #13370 from ethereum/ppa_release_fixes
Little enhancements to the ppa release script
2 parents b9967c6 + 0fab970 commit 51e2259

File tree

2 files changed

+48
-12
lines changed

2 files changed

+48
-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: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@
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 "[email protected]" 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 .release_ppa_auth in the root directory of
17+
## the project to your launchpad email and pgp keyid.
18+
## This could for example look like this:
19+
##
20+
21+
## LAUNCHPAD_KEYID=123ABCFFFFFFFF
22+
##
23+
## Additionally the following entries in /etc/dput.cf are required:
1924
##
2025
## [ethereum-dev]
2126
## fqdn = ppa.launchpad.net
@@ -34,11 +39,17 @@
3439
## method = ftp
3540
## incoming = ~ethereum/ethereum-static
3641
## login = anonymous
37-
3842
##
3943
##############################################################################
4044

41-
set -ev
45+
set -e
46+
47+
48+
REPO_ROOT="$(dirname "$0")/.."
49+
50+
# for the "fail" function
51+
# shellcheck source=scripts/common.sh
52+
source "${REPO_ROOT}/scripts/common.sh"
4253

4354
if [ -z "$1" ]
4455
then
@@ -51,17 +62,39 @@ is_release() {
5162
[[ "${branch}" =~ ^v[0-9]+(\.[0-9]+)*$ ]]
5263
}
5364

54-
keyid=379F4801D622CDCF
55-
65+
# source keyid and email from .release_ppa_auth
66+
if [[ -e .release_ppa_auth ]]
67+
then
68+
# shellcheck source=/dev/null
69+
source "${REPO_ROOT}/.release_ppa_auth"
70+
fi
71+
72+
[[ "$LAUNCHPAD_KEYID" != "" && "$LAUNCHPAD_EMAIL" != "" ]] || \
73+
fail "Error: Couldn't find variables \$LAUNCHPAD_KEYID or \$LAUNCHPAD_EMAIL in sourced file .release_ppa_auth (check top comment in $0 for more information)."
74+
5675
packagename=solc
5776

58-
static_build_distribution=impish
77+
# This needs to be a still active release
78+
static_build_distribution=focal
5979

60-
DISTRIBUTIONS="focal impish jammy kinetic"
80+
DISTRIBUTIONS="focal jammy kinetic"
81+
82+
function checkDputEntries {
83+
local pattern="$1"
84+
grep "${pattern}" /etc/dput.cf --quiet || \
85+
fail "Error: Missing ${pattern//\\/} section in /etc/dput.cf (check top comment in ${0} for more information)."
86+
}
6187

6288
if is_release
6389
then
6490
DISTRIBUTIONS="$DISTRIBUTIONS STATIC"
91+
92+
# Sanity checks
93+
checkDputEntries "\[ethereum\]"
94+
checkDputEntries "\[ethereum-static\]"
95+
else
96+
# Sanity check
97+
checkDputEntries "\[ethereum-dev\]"
6598
fi
6699

67100
for distribution in $DISTRIBUTIONS
@@ -245,7 +278,7 @@ chmod +x debian/rules
245278

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

250283

251284
# build source package
@@ -287,7 +320,7 @@ fi
287320
)
288321

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

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

0 commit comments

Comments
 (0)