Skip to content
Snippets Groups Projects
Commit 5829c71a authored by Thomas Buckley-Houston's avatar Thomas Buckley-Houston
Browse files

Centralise all the Browsh build steps

parent 9abc3aaa
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ env:
- secure: "boYctu4EQI2og3YWpD54yo1LzibgBNrYN3exbfwxaNNbJuQscprAlOOG5Y1O7MBgzG9AP1DeON3X0al7g/IYMrsMsrSGhJLq9w2/ntwMiUIyKfTAP8rB5fASRSYxA5mqhpjXK4iIzqG2xiOr1SmCbpT9ew0AXP/HgxQprsppBbH+H4HyrP4cejIbfk8ajU/XvrDmhOY4s/IZIy+vfEfZH5xheJnG3iWFICwWUF5CIjjr6fQpq9ZbL2sDMvzruYPMAQ3iDfBrUr+ZhN4PPjrzvCRUNpoUoPsXCsFDPMcZpBjSHH5ZELPRBzHSdJignIjHaV0UtLtFApZl49lzq749r2Sno2ba4JCd0RIgMERjNluXynkJiHrL2tMR8HYhOmoeLMdX0zrguv+136+Jn04gQde3S+FI1/sN0/Xa14xD7SGMUT1MgFnwKgFXOFeUd3VpvbpFg6RWVgpCnaDd2/AKL+mQDEgL4yRg9q95a6Q5ub/c6nla8/E4asEvYGlJPj0OG/MKvJMi0gnKuP4+nil0jgGeKki3k1UxwvldlS+n7HUhQ7c4B9c61KS19i+z5SxBiXjilL+zGlAVVgRcalIoKQrTRDSRKnKZkR5Ant0CLjt44pncHLwlYXD/aPuLNihCa4AqUlpYPYru0pQawXNkVnk6E/cg2DAsp7oDcpcg540="
before_install:
- ./interfacer/contrib/setup_go.sh
- ./interfacer/contrib/setup_dep.sh
- ./webext/contrib/setup_node.sh
- mkdir -p $REPO_ROOT && cp -rfp $TRAVIS_BUILD_DIR -T $REPO_ROOT
install:
......
......@@ -27,14 +27,7 @@ ENV BASE=$GOPATH/src/browsh/interfacer
WORKDIR $BASE
ADD interfacer $BASE
# Install `dep` the current defacto dependency manager for Golang
RUN $BASE/contrib/setup_dep.sh
# Install the tool to convert the web extenstion file into a Go-compatible binary
RUN go get -u gopkg.in/shuLhan/go-bindata.v3/...
# Build Browsh
RUN dep ensure
RUN $BASE/contrib/build_browsh.sh
......
......@@ -4,27 +4,45 @@
# To build Browsh during development see:
# https://github.com/browsh-org/browsh#contributing
# This script depends on Golang and go-bindata
# `go get -u gopkg.in/shuLhan/go-bindata.v3/...`
# This script depends on Golang, dep and go-bindata
# See; ./setup_dep.sh for an example `dep` installation
# `go-bindata` can be easily installed with:
# `go get -u gopkg.in/shuLhan/go-bindata.v3/...`
# `dep esnure` must be run in `interfacer/`
set -e
INTERFACER_ROOT=$(readlink -m "$( cd "$(dirname "$0")" ; pwd -P )"/../)
cd $INTERFACER_ROOT
# Install `dep` the current defacto dependency manager for Golang
./contrib/setup_dep.sh
# Install the tool to convert the web extenstion file into a Go-compatible binary
go get -u gopkg.in/shuLhan/go-bindata.v3/...
# Install Golang dependencies
dep ensure
# Get the current Browsh version, in order to find the corresponding web extension release
version_file=$INTERFACER_ROOT/src/browsh/version.go
line=$(cat $version_file | grep 'browshVersion')
version=$(echo $line | grep -o '".*"' | sed 's/"//g')
# Build the URI for the webextension file
base='https://github.com/browsh-org/browsh/releases/download'
release_url="$base/v$version/browsh-${version}-an.fx.xpi"
xpi_file=$INTERFACER_ROOT/browsh.xpi
destination=$INTERFACER_ROOT/src/browsh/webextension.go
# Download the web extension
curl -L -o $xpi_file $release_url
# Convert the web extension into binary data that can be compiled into a
# cross-platform Go binary.
XPI_FILE=$xpi_file BIN_FILE=$destination \
$INTERFACER_ROOT/contrib/xpi2bin.sh
cd $INTERFACER_ROOT
# The actual build iteself
go build -o browsh src/main.go
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment