Skip to content
This repository has been archived by the owner on Nov 17, 2017. It is now read-only.

Commit

Permalink
Fixes to release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
diracdeltas committed May 1, 2014
1 parent 892279d commit 71707cb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,4 +3,6 @@
addon-sdk-*
*.xpi
*~
release-utils/pkg
release-utils/xpi
**packages
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -2,6 +2,6 @@

# this rule makes tag or branch targets
%:
./release-utils/make-signed-xpi.sh $@
./release-utils/firefox-release.sh $@
clean:
rm -r ./release-utils/pkg
rm -r ./release-utils/xpi
15 changes: 9 additions & 6 deletions release-utils/firefox-release.sh
@@ -1,13 +1,16 @@
#!/bin/bash

set -e
cd "`dirname $0`"

RDFDIR=pkg/

# To make an Privacy Badger firefox release
# To make an Privacy Badger firefox release, signed with an offline key

# 1. get the repo into a sane state for a release
# 2. ensure that doc/Changelog approximately describes this release
# 3. tag the release with "git tag -s <release version number>"
# 4. run this script with <release vesion number> as the argument
# 4. run this script with <release version number> as the argument


if [ $# -ne 1 ] ; then
Expand All @@ -25,14 +28,14 @@ if ! [ -x `which festival` ] ; then
echo "festival is not installed, cannot speak hashes aloud..."
fi

PKG=pkg/privacy-badger-$TARGET.xpi
ALT=pkg/privacy-badger-latest.xpi
PKG=$RDFDIR/privacy-badger-$TARGET.xpi
ALT=$RDFDIR/privacy-badger-latest.xpi
RDFFILE=$RDFDIR/privacy-badger-update-2048.rdf

LZMARDF=$RDFFILE.lzma
B_LZMARDF=$LZMARDF.b64

if ! make $TARGET ; then
if ! ./make-signed-xpi.sh $TARGET ; then
echo "Failed to build target $TARGET"
exit 1
fi
Expand All @@ -42,7 +45,7 @@ if ! [ -f "$PKG" ] ; then
exit 1
fi


# XXX: Why make a gpg detached sig?
echo "Making (secondary) GPG signature"
gpg --detach-sign $PKG

Expand Down
3 changes: 2 additions & 1 deletion release-utils/install-template.rdf
@@ -1,5 +1,6 @@
<!-- Custom data for signed XPI -->
<em:homepageURL>https://www.eff.org/privacybadger</em:homepageURL>
<em:updateURL>https://www.eff.org/files/https-everywhere-update-2048.rdf</em:updateURL>
<em:updateURL>https://www.eff.org/files/privacy-badger-update-2048.rdf</em:updateURL>
<em:updateKey>MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6MR8W/galdxnpGqBsYbqOzQb2eyW15YFjDDEMI0ZOzt8f504obNs920lDnpPD2/KqgsfjOgw2K7xWDJIj/18xUvWPk3LDkrnokNiRkA3KOx3W6fHycKL+zID7zy+xZYBuh2fLyQtWV1VGQ45iNRp9+Zo7rH86cdfgkdnWTlNSHyTLW9NbXvyv/E12bppPcEvgCTAQXgnDVJ0/sqmeiijn9tTFh03aM+R2V/21h8aTraAS24qiPCz6gkmYGC8yr6mglcnNoYbsLNYZ69zF1XHcXPduCPdPdfLlzVlKK1/U7hkA28eG3BIAMh6uJYBRJTpiGgaGdPd7YekUB8S6cy+CQIDAQAB</em:updateKey>
</Description>
</RDF>
23 changes: 16 additions & 7 deletions release-utils/make-signed-xpi.sh
Expand Up @@ -5,36 +5,45 @@ cd "`dirname $0`"
APP_NAME=privacybadgerfirefox
# Auto-generated XPI name from 'cfx xpi'
PRE_XPI_NAME="$APP_NAME.xpi"
LATEST_SDK_VERSION=1.16

if ! type cfx > /dev/null; then
echo "Please activate the Firefox Addon SDK before running this script."
exit 1
fi

if ! cfx --version | grep -q "$LATEST_SDK_VERSION"; then
echo "WARNING: Not using the latest stable SDK version"
fi

if [ $# -ne 1 ] ; then
echo "Usage: $0 <version to release>"
exit 1
fi

# Final XPI name
XPI_NAME="$APP_NAME-$1.xpi"
XPI_NAME="privacy-badger-$1.xpi"

rm -rf pkg/
mkdir pkg
rm -rf xpi/
mkdir xpi

# Build the unsigned XPI and unzip it
echo "Running cfx xpi"
cfx xpi
unzip -q -d pkg "$PRE_XPI_NAME"
unzip -q -d xpi "$PRE_XPI_NAME"
rm "$PRE_XPI_NAME"

# Customize install.rdf with our updateKey and URL
sed -i 's@</RDF>@\n@g' pkg/install.rdf
cat install-template.rdf >> pkg/install.rdf
sed -i ':a;N;$!ba;s@</Description>\n</RDF>@\n@g' xpi/install.rdf
cat install-template.rdf >> xpi/install.rdf

# Rezip the XPI
rm -f "$XPI_NAME"
cd pkg
cd xpi
zip -q -X -9r "$XPI_NAME" .

echo "Created $XPI_NAME in $(pwd)"

# Move it to the canonical location
mkdir -p ../pkg
mv "$XPI_NAME" ../pkg/

0 comments on commit 71707cb

Please sign in to comment.