forked from monkeyman192/MBINCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (66 loc) · 2.65 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
language: csharp
solution: MBINCompiler.sln
mono: latest
dotnet: 2.2.109
before_install:
# Set the `python` command to be python 3
- pyenv install 3.6.3
- pyenv global 3.6.3
install:
- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.6.1/
- python3.6 -m pip install --user pytest requests
script:
- dotnet restore
- dotnet build -r win-x64 -p:Configuration=Release /nowarn:cs0618
# Build a linux version for running python tests
- dotnet restore
- dotnet build -r ubuntu.16.04-x64 -p:Configuration=Release /nowarn:cs0618
# cwd: /home/travis/build/monkeyman192/MBINCompiler
- sudo chmod +x Build/Release/ubuntu.16.04-x64/MBINCompiler.exe
# Run the tests
- python3.6 -m pytest --platform ubuntu.16.04-x64 --tb=no --report
#- msbuild /p:Configuration=Release MBINCompiler.sln
#- dotnet test
before_deploy:
- export LIBMBIN_VERSION="$(cat libMBIN/Source/Version.cs | grep -P 'const[[:space:]]+string[[:space:]]+VERSION_STRING' | grep -oP '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+')"
- "echo \"LIBMBIN_VERSION: $LIBMBIN_VERSION\""
- "[[ \"$TRAVIS_TAG\" =~ ^v([[:digit:]]+)[.]([[:digit:]]+)[.]([[:digit:]]+)(-[^[:digit:]]+([[:digit:]]+)|[.]([[:digit:]])+) ]] && export MATCH_TAG=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}.${BASH_REMATCH[5]}${BASH_REMATCH[6]}"
- "echo \"Tag: $TRAVIS_TAG -> $MATCH_TAG\""
- "[[ \"$MATCH_TAG\" == \"$LIBMBIN_VERSION\" ]] && echo \"$TRAVIS_TAG matches LIBMBIN_VERSION.\" || echo \"Error: The version tag $TRAVIS_TAG must match the LIBMBIN_VERSION defined in Version.cs\" && set -e"
#
# Set up git user name and tag this commit
#
#- export TRAVIS_TAG=v$LIBMBIN_VERSION-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)
#- git config --local user.name "Travis-CI"
#- git config --local user.email "noreply@email.com"
#- git tag $TRAVIS_TAG
# see https://docs.travis-ci.com/user/deployment/releases/
deploy:
provider: releases
prerelease: true
name: "${TRAVIS_TAG}"
body: "${TRAVIS_TAG}"
api_key: "${GITHUB_TOKEN}"
skip_cleanup: true
file:
- "Build/Release/libMBIN.dll"
- "Build/Release/win-x64/MBINCompiler.exe"
- "report.json"
on:
branch: development
tags: true
condition: "$TRAVIS_TAG =~ ^v[[:digit:]]"
deploy:
provider: releases
name: "${TRAVIS_TAG}"
body: "${TRAVIS_TAG}"
api_key: "${GITHUB_TOKEN}"
skip_cleanup: true
file:
- "Build/Release/libMBIN.dll"
- "Build/Release/win-x64/MBINCompiler.exe"
- "report.json"
on:
branch: master
tags: true
condition: "$TRAVIS_TAG =~ ^v[[:digit:]]"