This repository has been archived by the owner on May 22, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Psiphon Android app build & other CI improvements (#78)
- Loading branch information
1 parent
6951fcd
commit 2729691
Showing
5 changed files
with
90 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,77 @@ | ||
language: go | ||
|
||
go: | ||
- "1.10" | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
os: linux | ||
sudo: required | ||
dist: trusty | ||
|
||
services: | ||
- docker | ||
|
||
addons: | ||
artifacts: true | ||
apt: | ||
packages: | ||
- libegl1-mesa-dev | ||
- libgles2-mesa-dev | ||
- libx11-dev | ||
|
||
install: | ||
- go get -t ./... | ||
- go get github.com/golang/lint/golint | ||
# Install gometalinter | ||
- go get github.com/alecthomas/gometalinter | ||
# Get Psiphon code | ||
- mkdir -p $GOPATH/src/github.com/Psiphon-Labs | ||
- git clone https://github.com/Psiphon-Labs/psiphon-tunnel-core.git $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core | ||
- go get github.com/kardianos/govendor | ||
- (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && govendor remove github.com/sergeyfrolov/gotapdance/...) | ||
- sed -i -e 's/refraction_networking_tapdance.Logger().Out = ioutil.Discard//' $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/tapdance/tapdance.go | ||
|
||
script: | ||
- go test -race -v ./tapdance/ | ||
- go test -race -v ./tdproxy/ | ||
- gometalinter --install | ||
- gometalinter --disable-all -E vet -E gofmt -E misspell -E ineffassign -E deadcode --tests ./tapdance/ | ||
# Build Psiphon ConsoleClient | ||
- go build -race -tags 'TAPDANCE' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient | ||
|
||
notifications: | ||
slack: | ||
secure: ZzIEqFE4XRdE9U2p3aeE32DMtoC8RgjoEavhEQ1oLrWFgUpLktqmp9UVY/U+W6iElilLpDbFpry51+Sv9MWpxJMxr+Q/JJuq/3Bj5KjF/wEtil7qvBYhQ1sM/qUQFG6wRkrMNjZGMiaTmnkWF0rZB8lf7+nbnGFaPW3AVVbD+8gVDWTHI4Hcvvgs0UbrJzoPfpvH0dprOchswc1BBKTgo5c44rvS2fquEMVcqMMiNJ5JQqphuRWLTfzLgOzImSf0/xJJyVp/YTkSnVSg8BcWmDCJ4iB9fJkVyZM9WxcgY/J4T5VzFxfMah9zv2j8UTfzHSMeCJDRL647hdnkmr/Qum/LN91Ey2DJw5KUH743CsAbyGhQML6wZ3NCeEP06hnMDphalU5+BYhtAPyc5CB84g6eLIUQ2EqptuPZpjFQohFnapCTnfB5XKTcW+PjxJsoJzk8x+85Xid+H1nnNxeyf10tLv6Pwy4ZGmEEbsa4SYWXibpIEu3fPJXEdtrht0vM40pDLeUYL6Axmh7hNjmDQOXJG41saF+Rk4AArRhKhMQTmlYCc0e1H2/hIDXUMPbqjHeCpEkaA5W8BFBKynhlJa0JX+rtHDFaK82Di8rXT0NO2ACyG8ZQqk87qePyBYPyfR8hRwhrkmQHlYYOZzV6LBz+ynJuWl9ktcC2irJlHZs= | ||
|
||
jobs: | ||
include: | ||
- stage: test | ||
name: "Test and lint gotapdance" | ||
install: | ||
- go get -t ./... | ||
- go get github.com/golang/lint/golint | ||
- go get github.com/alecthomas/gometalinter | ||
script: | ||
- go test -race -v ./tapdance | ||
- go test -race -v ./tdproxy | ||
- gometalinter --install | ||
- gometalinter --disable-all -E vet -E gofmt -E misspell -E ineffassign -E deadcode --tests ./tapdance | ||
|
||
- &build # YAML anchor/alias | ||
stage: build | ||
name: "Build cli and Psiphon ConsoleClient on Linux" | ||
install: | ||
- go get ./... | ||
# Substitute build string | ||
- sed -i.bak "s/\[BUILD\]/$TRAVIS_BRANCH-$TRAVIS_COMMIT/" tapdance/logger.go | ||
- mkdir -p $GOPATH/src/github.com/Psiphon-Labs | ||
- git clone https://github.com/Psiphon-Labs/psiphon-tunnel-core.git $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core | ||
# Remove gotapdance from vendored packages | ||
- go get github.com/kardianos/govendor | ||
- (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && govendor remove github.com/sergeyfrolov/gotapdance/...) | ||
# Enable TapDance logging | ||
- sed -i.bak 's/refraction_networking_tapdance.Logger().Out = ioutil.Discard//' $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/tapdance/tapdance.go | ||
script: | ||
- go build -o build/cli-$TRAVIS_OS_NAME ./cli | ||
- go build -o build/ConsoleClient-$TRAVIS_OS_NAME -tags 'TAPDANCE' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient | ||
after_success: | ||
# Upload built binaries to S3 | ||
- sudo pip install awscli | ||
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then aws s3 sync build s3://$ARTIFACTS_BUCKET/$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/; fi | ||
|
||
- <<: *build # Same build on OS X | ||
name: "Build cli and Psiphon ConsoleClient on OS X" | ||
os: osx | ||
|
||
- <<: *build # Reuse setup steps from build | ||
name: "Build Psiphon Android Library and App" | ||
before_script: | ||
# Get Android build environment | ||
- docker pull refraction/psiandroid | ||
- mkdir -p $GOPATH/src/bitbucket.org/psiphon | ||
- hg clone https://bitbucket.org/psiphon/psiphon-circumvention-system $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system | ||
# Use modified EmbeddedValues.java for TapDance | ||
- openssl aes-256-cbc -d -K $encrypted_8a9748c534c1_key -iv $encrypted_8a9748c534c1_iv -in build/EmbeddedValues.java.enc -out $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/EmbeddedValues.java | ||
# Patched tunneling protocol for TapDance | ||
- patch $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/TunnelManager.java build/TunnelManager.java.patch | ||
script: | ||
# Build Psiphon Android Library ca.psiphon.aar | ||
- docker run -v $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core:/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core refraction/psiandroid /bin/bash -c 'cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android && ./make.bash "TAPDANCE"' | ||
- mv $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android/ca.psiphon.aar build/ | ||
# Build Psiphon Android App PsiphonAndroid-debug.apk | ||
- cp build/ca.psiphon.aar $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/libs/ | ||
- docker run -v $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android:/go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android refraction/psiandroid /bin/bash -c 'yes | /android-sdk-linux/tools/bin/sdkmanager --update && cd /go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android && ./gradlew assembleDebug' | ||
- sudo mv $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/build/outputs/apk/debug/PsiphonAndroid-debug.apk build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@@ -732,6 +732,9 @@ | ||
json.put("EgressRegion", egressRegion); | ||
} | ||
|
||
+ json.put("TunnelProtocol", "TAPDANCE-OSSH"); | ||
+ json.put("DisableTactics", true); | ||
+ | ||
if (tunnelConfig.disableTimeouts) { | ||
//disable timeouts | ||
MyLog.g("DisableTimeouts", "disableTimeouts", true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters