forked from ipsn/go-libtor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
48 lines (36 loc) · 1.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
language: go
go: 1.13.x
# Cron jobs push tags, don't insta-rebuild after a cron task
branches:
only:
- master
services:
- docker
install: true
before_script:
# Install Tor dependencies for autoconf, we won't actually use them
- sudo apt-get install -y libevent-dev zlib1g-dev
# Configure the SSH key to pull and push the repository
- echo $GITHUB_PUSH_KEY | base64 -d > ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
# Switch the entire repository over to master
- git remote add upstream git@github.com:ipsn/go-libtor.git
- git fetch upstream
- git checkout master
# Update anything enw and wrap the libraries
- go run build/wrap.go --nobuild
# Commit all the changes made to the repository and bump the version
- git add .
- if [ -n "$(git status --porcelain)" ]; then
git commit --author="Péter Szilágyi <peterke@gmail.com>" -m "Updated libtor dependencies";
tag=`git describe --tags --abbrev=0` && git tag "`echo $tag | cut -d '.' -f -2`.$((`echo $tag | cut -d '.' -f 3`+1))";
fi
# Ensure we can build the library both on libc and musl (amd64)
- docker build -f ./build/Dockerfile.ubuntu .
- docker build -f ./build/Dockerfile.alpine .
# Ensure we can build the library on arm and arm64
- go get -u github.com/karalabe/xgo
- xgo --targets=linux/arm-7,linux/arm64 .
script:
# Everything seems ok, push the master branch back to GitHub
- git push upstream master --tags