Skip to content

Commit f1b66f0

Browse files
committed
automate entire build process
1 parent 5538e37 commit f1b66f0

File tree

3 files changed

+44
-14
lines changed

3 files changed

+44
-14
lines changed

chromium/updates.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
33
<app appid='eonedblccmhcfofhololkdjedafocaod'>
4-
<updatecheck codebase='https://github.com/downloads/aaronsw/https-everywhere/https-everywhere-0.0.8.1.crx' version='0.0.8.1' />
4+
<updatecheck codebase='https://github.com/downloads/aaronsw/https-everywhere/https-everywhere-0.0.8.2.crx' version='0.0.8.2' />
55
</app>
66
</gupdate>

githubhelper.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import json, urllib, sys, os, subprocess
2+
3+
from tokenkeys import oauth_token
4+
5+
VERSION = sys.argv[1]
6+
fn = 'pkg/https-everywhere-%s.crx' % VERSION
7+
8+
results = json.load(urllib.urlopen('https://api.github.com/repos/aaronsw/https-everywhere/downloads?access_token=%s' % oauth_token, json.dumps(dict(
9+
name=fn,
10+
size=os.stat(fn).st_size,
11+
description='Release of version %s' % VERSION,
12+
content_type='application/x-chrome-extension'
13+
))))
14+
15+
subprocess.Popen(['curl',
16+
'-F', 'key=%s' % results['path'],
17+
'-F', "acl=%s" % results['acl'],
18+
'-F', "success_action_status=201",
19+
'-F', "Filename=%s" % results['name'],
20+
'-F', "AWSAccessKeyId=%s" % results['accesskeyid'],
21+
'-F', "Policy=%s" % results['policy'],
22+
'-F', "Signature=%s" % results['signature'],
23+
'-F', "Content-Type=%s" % results['mime_type'],
24+
'-F', "file=@%s" % fn,
25+
'https://github.s3.amazonaws.com/']).wait()
26+
27+
print '\nUploaded.'

makecrx.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# How to do a new release:
44
#
5-
# 1. Visit https://github.com/aaronsw/https-everywhere/downloads
6-
# and find the latest version number. Increment it and let the
7-
# result be $NEWVERSION. So if the latest is 0.0.7.1, then let
8-
# NEWVERSION=0.0.7.2.
9-
# 2. Run: ./makecrx.sh $NEWVERSION
10-
# 3. Upload pkg/https-every-$NEWVERSION.crx to Github.
11-
# 4. Run:
12-
# git add chromium/updates.xml
13-
# git commit -m "release $NEWVERSION"
14-
# git push
5+
# 1. Run: ./makecrx.sh
6+
# 2. It'll ask you to name the new version.
157

16-
VERSION=$1
8+
echo -n "previous versions: "; curl -s "https://api.github.com/repos/aaronsw/https-everywhere/downloads" | grep name | head -n 3 | sed -e 's/ "name": "https-everywhere-//' | sed -e "s/.crx\",/ /" | tr '\n' ' '; echo
9+
10+
echo -n "New version: "
11+
read VERSION
1712

1813

1914
sed -e "s/VERSION/$VERSION/g" chromium/updates-master.xml > chromium/updates.xml
@@ -66,4 +61,12 @@ sig_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$sig" | awk '{print $5}')))
6661
echo "$crmagic_hex $version_hex $pub_len_hex $sig_len_hex" | xxd -r -p
6762
cat "$pub" "$sig" "$zip"
6863
) > "$crx"
69-
echo "Built .crx."
64+
echo "Built .crx."
65+
66+
python githubhelper.py $VERSION
67+
68+
git add chromium/updates.xml
69+
git commit -m "release $VERSION"
70+
git tag -s chrome-$VERSION "release $VERSION"
71+
git push
72+
git push --tags

0 commit comments

Comments
 (0)