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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
language: python
branches:
only:
- master
- develop
- pytests_inkscape_1_0
virtualenv:
system_site_packages: true
matrix:
include:
- os: linux
dist: bionic
python: '3.6'
addons:
apt:
packages:
- python3-gi
- python3-gi-cairo
- gir1.2-gtk-3.0
- texlive-latex-base
- texlive-fonts-recommended
- texlive-lang-cyrillic
- cm-super
- libxml2-utils
- os: linux
dist: focal
python: '3.8'
addons:
apt:
packages:
- python3-gi
- python3-gi-cairo
- gir1.2-gtk-3.0
- texlive-latex-base
- texlive-fonts-recommended
- texlive-lang-cyrillic
- cm-super
- libxml2-utils
env:
- RELEASE_MAKER=true
before_script:
- python -m pip install pytest lxml Pillow
- sudo add-apt-repository --yes ppa:inkscape.dev/stable
- sudo apt update
- sudo apt install inkscape
- python test_installation_script.py 2> /dev/null
- python setup.py
- wget https://gitlab.com/inkscape/extensions/raw/master/inkscape.extension.rng
script:
- export PYTHONPATH="`inkscape --system-data-directory`/extensions:$HOME/.config/inkscape/extensions/"
- python -m pytest --verbose -s pytests
- xmllint --noout --relaxng inkscape.extension.rng textext/textext.inx
after_success:
# Put a tag if version has changed and (version contains "-dev" on develop) or (version DOES NOT contain "-dev" on master)
# Reminder: grep -q returns 0 if any match has been found, otherwise nonzero.
- VERSION_CHANGED=$(git diff --no-commit-id --name-only -r $TRAVIS_COMMIT_RANGE | grep -q textext/VERSION; echo $?;)
- VERSION=$(head -n 1 textext/VERSION)
- echo 'Version changed :' $( [ "$VERSION_CHANGED" == 0 ] && echo "Yes" || echo "No")
- echo 'Version :' $VERSION
- echo 'Travis branch :' $TRAVIS_BRANCH
- echo 'Is develop release :' $( [ $( (echo $VERSION | grep -q "\-dev"); echo $?) == 0 ] && echo "Yes" || echo "No")
- echo 'Condition for tagging met :' $( [ $( ( [ "$TRAVIS_BRANCH" == "develop" ] && (echo $VERSION | grep -q "\-dev") ) || ( [ "$TRAVIS_BRANCH" == "master" ] && (echo $VERSION | grep -v -q "\-dev") ) ; echo $?) == 0 ] && echo "Yes" || echo "No")
- echo 'Is a release maker :' $( [ "RELEASE_MAKER"==true ] && echo "Yes" || echo "No")
- echo 'Condition for pre-release met :' $( [ $( (echo $VERSION | grep -q "\-"); echo $?) == 0 ] && echo "Yes" || echo "No")
- echo '(echo $VERSION | grep "\-dev") :' $( (echo $VERSION | grep "\-dev"); echo $?) ' --> -q --> ' $( (echo $VERSION | grep -q "\-dev"); echo $?)
- echo '(echo $VERSION | grep -v "\-dev") :' $( (echo $VERSION | grep -v "\-dev"); echo $?) ' --> -q --> ' $( (echo $VERSION | grep -v -q "\-dev"); echo $?)
- if [[ $VERSION_CHANGED = 0 ]] && ( ( [ "$TRAVIS_BRANCH" == "develop" ] && (echo $VERSION | grep -q "\-dev") ) || ( [ "$TRAVIS_BRANCH" == "master" ] && (echo $VERSION | grep -v -q "\-dev") ) ) ; then
git tag -l $VERSION | grep -q $VERSION || git tag $VERSION -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER";
if [[ $RELEASE_MAKER = true ]];
then DO_RELEASE=true;
fi;
fi;
- if echo $VERSION | grep -q "\-" ;
then export GITHUB_DEPLOY_PRERELEASE=true;
else export GITHUB_DEPLOY_PRERELEASE=false;
fi
- if [ $GITHUB_DEPLOY_PRERELEASE = false ] && [ $RELEASE_MAKER ];
then DO_GH_PAGES=true;
fi;
before_deploy:
- bash build_docs.sh
- python build_packages.py
- git config --global user.email "builds@travis-ci.com" # Check if you are connected with .com or .org !!
- git config --global user.name "Travis CI"
deploy:
- provider: pages
verbose: true
local-dir: docs/build/html
skip-cleanup: true
github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep-history: false
on:
tags: false
branch: master
condition: $DO_GH_PAGES
- provider: releases
api_key: $GITHUB_TOKEN
prerelease: $GITHUB_DEPLOY_PRERELEASE
skip_cleanup: true
file_glob: true
file: assets/*
on:
tags: false
all_branches: true # only develop and master are activated in travis
condition: $DO_RELEASE
|