forked from multiversx/mx-chain-vm-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
72 lines (64 loc) · 2.41 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
language: go
go: '1.13'
os:
- linux
- osx
arch:
- amd64
#- arm64
osx_image: xcode11.3
before_install:
- if [[ $TRAVIS_OS_NAME == linux ]]; then sudo apt-get install -y patchelf; fi
before_script:
- APP_VER=$(git describe --tags --long --dirty)
- APP_VER_SHORT=$(git describe --tags)
- GOOS=$(go env GOOS)
- GOARCH=$(go env GOARCH)
- ARCHIVE="ARWEN_""$APP_VER_SHORT""_""$GOOS""_""$GOARCH"".tar.gz"
script:
# In order to run the tests, use the absolute path to libwasmer
- if [[ "$GOOS" == darwin && "$GOARCH" == amd64 ]];
then
install_name_tool -id $TRAVIS_BUILD_DIR/wasmer/libwasmer_darwin_amd64.dylib $TRAVIS_BUILD_DIR/wasmer/libwasmer_darwin_amd64.dylib;
fi
- make test-short
# For building, use a relative path to libwasmer
- if [[ "$GOOS" == darwin && "$GOARCH" == amd64 ]];
then
install_name_tool -id @executable_path/libwasmer_darwin_amd64.dylib $TRAVIS_BUILD_DIR/wasmer/libwasmer_darwin_amd64.dylib;
fi
- if [[ "$GOOS" == linux && "$GOARCH" == amd64 ]];
then
patchelf --set-soname libwasmer_linux_amd64.so $TRAVIS_BUILD_DIR/wasmer/libwasmer_linux_amd64.so;
fi
- go build -o "$TRAVIS_BUILD_DIR/build/arwen" -ldflags="-X main.appVersion=$APP_VER" $TRAVIS_BUILD_DIR/cmd/arwen
- go build -o "$TRAVIS_BUILD_DIR/build/arwendebug" -ldflags="-X main.appVersion=$APP_VER" $TRAVIS_BUILD_DIR/cmd/arwendebug
- go build -o "$TRAVIS_BUILD_DIR/build/test" -ldflags="-X main.appVersion=$APP_VER" $TRAVIS_BUILD_DIR/cmd/test
- if [[ "$GOOS" == linux && "$GOARCH" == amd64 ]]; then cp -f $TRAVIS_BUILD_DIR/wasmer/libwasmer_linux_amd64.so $TRAVIS_BUILD_DIR/build; fi
- if [[ "$GOOS" == darwin && "$GOARCH" == amd64 ]]; then cp -f $TRAVIS_BUILD_DIR/wasmer/libwasmer_darwin_amd64.dylib $TRAVIS_BUILD_DIR/build; fi
- if [[ "$GOOS" == linux && "$GOARCH" == amd64 ]];
then
cd $TRAVIS_BUILD_DIR/build &&
ls &&
patchelf --set-rpath "\$ORIGIN" ./arwen &&
patchelf --set-rpath "\$ORIGIN" ./arwendebug &&
patchelf --set-rpath "\$ORIGIN" ./test;
fi
before_deploy:
- mkdir -p $TRAVIS_BUILD_DIR/travis-builds
- cd "$TRAVIS_BUILD_DIR/build"
- tar czvf "$TRAVIS_BUILD_DIR/travis-builds/$ARCHIVE" *
- echo "Will deploy to Amazon S3 (https://ide.elrond.com):"
- echo $ARCHIVE
deploy:
provider: s3
access_key_id: $AWS_KEY_ID
secret_access_key: $AWS_SECRET_KEY
bucket: ide.elrond.com
skip_cleanup: true
local-dir: $TRAVIS_BUILD_DIR/travis-builds
upload-dir: travis-builds
on:
branch:
- master
- arwentools*