-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
94 lines (90 loc) · 3.55 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Config file for automatic testing at travis-ci.com
language: python
stages:
- test
- name: deploy
# require the branch name to be master (note for PRs this is the base branch name)
if: tag is present
jobs:
include:
- python: "3.8"
- name: "Python 3.8 on Windows"
os: windows
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.8.0
- python -m pip install --upgrade pip
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH
- stage: deploy
python: 3.8
script: skip # usually you do not want to rerun any tests
before_deploy:
- poetry config http-basic.pypi $MYPYPI_USER $MYPYPI_PASS
- poetry install -v
- poetry build
- poetry run pyinstaller $MY_GH_REPO_NAME/cli.py -n $MY_GH_REPO_NAME --onefile
- tar cvzf dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.tar.gz dist/$MY_GH_REPO_NAME
- sha256sum dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.tar.gz > dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.tar.gz.sha256
- ls -R dist
deploy:
- provider: script
skip_cleanup: true
script: poetry publish
on:
tags: true
repo: $TRAVIS_REPO_SLUG
branch: master
- provider: releases
skip_cleanup: true
api_key: $GITHUB_RELEASE_TOKEN
file_glob: true
file: dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.*
on:
tags: true
repo: $TRAVIS_REPO_SLUG
branch: master
- stage: deploy
os: windows
language: shell
before_install:
- choco install python --version 3.8.0
- python -m pip install --upgrade pip
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
script: skip # usually you do not want to rerun any tests
before_deploy:
- poetry install -v
- poetry build
- poetry run pyinstaller $MY_GH_REPO_NAME/cli.py -n $MY_GH_REPO_NAME --onefile
- ls -R dist
- 7z a dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.zip ./dist/$MY_GH_REPO_NAME.exe
- ls -R dist
- sha256sum dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.zip > dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.zip.sha256
- ls -R dist
deploy:
- provider: releases
skip_cleanup: true
api_key: $GITHUB_RELEASE_TOKEN
file_glob: true
file: dist/$MY_GH_REPO_NAME-$TRAVIS_TAG-$TRAVIS_OS_NAME-$TRAVIS_CPU_ARCH.*
on:
tags: true
repo: $TRAVIS_REPO_SLUG
branch: master
# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
- export MY_GH_OWNER_NAME=$(echo ${TRAVIS_REPO_SLUG} | cut -f 1 -d /)
- export MY_GH_REPO_NAME=$(echo ${TRAVIS_REPO_SLUG} | cut -f 2 -d /)
- pip install -U poetry
- pip install -U tox-travis
- pip install -U coveralls
- pip install -U codecov
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ~/cc-test-reporter
- chmod +x ~/cc-test-reporter
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ~/cc-test-reporter before-build; fi
# Command to run tests, e.g. python setup.py test
script:
- tox
after_script:
- coveralls
- codecov
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ~/cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi