Skip to content

Commit

Permalink
refactor parts of release.sh into the grunt targets (#2797)
Browse files Browse the repository at this point in the history
remove release.sh and removekey.py, moving parts to separate scripts and integrating with grunt dist
  • Loading branch information
trevj committed Nov 2, 2016
1 parent 2223f67 commit a9a3f1c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 162 deletions.
6 changes: 5 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ module.exports = function(grunt) {
addIosrtcHookCmd: 'cp plugins/cordova-plugin-iosrtc/extra/hooks/iosrtc-swift-support.js hooks/iosrtc-swift-support.js',

exec: {
makeChromeWebStoreZips: {
command: 'tools/makechromezips.sh'
},
ccaCreateDev: {
// Pipe 'no' for the first time cca.js asks whether to send usage stats.
command: 'echo no | <%= ccaJsPath %> create <%= androidDevPath %> org.uproxy.uProxy "uProxy" --link-to=<%= ccaDevPath %>'
Expand Down Expand Up @@ -896,7 +899,8 @@ module.exports = function(grunt) {
// building, tests and lints all code.
registerTask(grunt, 'dist', [
'build',
'test'
'test',
'exec:makeChromeWebStoreZips'
]);

registerTask(grunt, 'compileTypescript', 'Compiles all the Typescript code', [
Expand Down
19 changes: 0 additions & 19 deletions removekey.py

This file was deleted.

142 changes: 0 additions & 142 deletions scraps/release.sh

This file was deleted.

46 changes: 46 additions & 0 deletions tools/makechromezips.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Creates the .zips used in preparation for
# releasing uProxy for Chrome:
# - build/dist/uproxy-chrome.zip is for team fishfood
# - build/dist/chrome/uproxy-chrome-*.zip have the key
# in their manifests stripped and are for uploading
# to the Chrome Web Store
#
# This is intended to be called as part of "grunt dist".

readonly DIST_DIR=build/dist
readonly REQUIRED_COMMANDS="zip jq"

set -e

if [[ ! -d $DIST_DIR ]]; then
echo "could not find directory $DIST_DIR, have you run grunt dist?" >&2
exit 1
fi

command_exists() {
command -v "$@" > /dev/null 2>&1
}

for command in $REQUIRED_COMMANDS; do
if ! command_exists $command; then
echo "could not $command, please install requirements first: $REQUIRED_COMMANDS" >&2
exit 1
fi
done

# Fishfood.
pushd $DIST_DIR &>/dev/null
zip -r uproxy-chrome.zip chrome

# Chrome Web Store.
pushd chrome &>/dev/null

for manifest in app/manifest.json extension/manifest.json; do
jq 'del(.key)' $manifest > $manifest.tmp
mv $manifest.tmp $manifest
done

zip -r uproxy-chrome-app.zip app
zip -r uproxy-chrome-extension.zip extension

0 comments on commit a9a3f1c

Please sign in to comment.