-
Notifications
You must be signed in to change notification settings - Fork 43
/
.travis.yml
50 lines (41 loc) · 2.1 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
language: python
env:
global:
- GITHUB_USERNAME: maxgalbu
- GITHUB_REPO: xbmc.plugin.video.nba
- GITHUB_REPOPATH: ${GITHUB_USERNAME}/${GITHUB_REPO}
- GITHUB_TAGNAME: nightly-${TRAVIS_BRANCH}
- ZIP_FILENAME: plugin.video.nba-${TRAVIS_BRANCH}.zip
- secure: "cZKjC9WwpG6izxaCnxnVcS7qT1ZOL2YB6JNnQvW3vcskQIHYLjUo0MrzQopb3/MExGE+GkaG6SeDwIQokLu+m2ESSi1SVr1j9fdZcWtjATkd5+mkvu8NlyO4vzTPbmlb6zjiXJ8LAQ8YQA4qBpoU92Y/FRuT2dt4an09+lyRaLE="
#Evito che travis lanci una compilazione ogni volta che si crea un tag
branches:
except:
- /^[0-9\.]+$/
- /^nightly-/
before_script:
- cd ..
#Rinomino la cartella
- mv $GITHUB_REPO plugin.video.nba
script:
#Creo zip
- zip $ZIP_FILENAME -x "*/.*" "*/docs/*" "*/*.pyc" "*/*.pyo" "*/*.pyo" -r ./plugin.video.nba
#Ritorno nella cartella per far funzionare il deploy
- cp $ZIP_FILENAME plugin.video.nba/
- cd plugin.video.nba
after_success:
#Creo un tag per creare una release su github
- git config --global user.email "[email protected]"
- git config --global user.name "Travis-CI"
- git remote rm origin
- git remote add origin https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/${GITHUB_USERNAME}/${GITHUB_REPO}
- git tag -d $GITHUB_TAGNAME
- git push origin :$GITHUB_TAGNAME --quiet 2> /dev/null
- git tag -a $GITHUB_TAGNAME -m 'latest version'
- git push origin $GITHUB_TAGNAME --quiet 2> /dev/null
#Download github-release
- wget "https://github.com/aktau/github-release/releases/download/v0.5.3/linux-amd64-github-release.tar.bz2"
- tar xvf linux-amd64-github-release.tar.bz2
#Uso https://github.com/aktau/github-release
- bin/linux/amd64/github-release delete --user $GITHUB_USERNAME --repo $GITHUB_REPO --tag $GITHUB_TAGNAME
- bin/linux/amd64/github-release release --user $GITHUB_USERNAME --repo $GITHUB_REPO --tag $GITHUB_TAGNAME --name "Latest version for branch ${TRAVIS_BRANCH}"
- bin/linux/amd64/github-release upload --user $GITHUB_USERNAME --repo $GITHUB_REPO --tag $GITHUB_TAGNAME --name "$ZIP_FILENAME" --file $ZIP_FILENAME