mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 21:18:32 +02:00
Merge pull request #761 from wren/travis-double-deploy-757
Fix CI config to only deploy once
This commit is contained in:
commit
864df05cc1
1 changed files with 121 additions and 60 deletions
181
.travis.yml
181
.travis.yml
|
@ -1,67 +1,128 @@
|
||||||
dist: xenial # required for Python >= 3.7
|
dist: xenial # required for Python >= 3.7
|
||||||
|
os: linux
|
||||||
language: python
|
language: python
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- pip
|
||||||
|
|
||||||
|
git:
|
||||||
|
depth: false
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- date
|
||||||
|
|
||||||
|
install:
|
||||||
|
- pip install poetry~=0.12.17
|
||||||
|
- poetry install
|
||||||
|
- poetry run python --version
|
||||||
|
|
||||||
|
script:
|
||||||
|
- poetry run behave
|
||||||
|
|
||||||
|
aliases:
|
||||||
|
test_mac: &test_mac
|
||||||
|
os: osx
|
||||||
|
language: shell
|
||||||
|
osx_image: xcode11.2
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.pyenv/versions
|
||||||
|
before_install:
|
||||||
|
- eval "$(pyenv init -)"
|
||||||
|
- pyenv install -s $JRNL_PYTHON_VERSION
|
||||||
|
- pyenv global $JRNL_PYTHON_VERSION
|
||||||
|
- pip install --upgrade pip
|
||||||
|
- pip --version
|
||||||
|
test_windows: &test_windows
|
||||||
|
os: windows
|
||||||
|
language: shell
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- /c/Python36
|
||||||
|
- /c/Python37
|
||||||
|
- /c/Python38
|
||||||
|
before_install:
|
||||||
|
- choco install python --version $JRNL_PYTHON_VERSION
|
||||||
|
- python -m pip install --upgrade pip
|
||||||
|
- pip --version
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
fast_finish: true
|
||||||
- name: "Python 3.6 on Linux"
|
|
||||||
python: 3.6
|
|
||||||
- name: "Python 3.7 on Linux"
|
|
||||||
python: 3.7
|
|
||||||
- name: "Python 3.7 on Linux, not UTC"
|
|
||||||
python: 3.7
|
|
||||||
env:
|
|
||||||
- TZ=America/Edmonton
|
|
||||||
- name: "Python 3.8 on Linux"
|
|
||||||
python: 3.8
|
|
||||||
- name: "Python dev on Linux"
|
|
||||||
python: nightly
|
|
||||||
- name: "Python 3.7.4 on MacOS"
|
|
||||||
os: osx
|
|
||||||
osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4
|
|
||||||
language: shell # 'language: python' is an error on Travis CI macOS
|
|
||||||
before_install:
|
|
||||||
- pip3 install poetry~=0.12.17 # 'pip' points to Python 2 on MacOS
|
|
||||||
- name: "Python 3.7.5 on Windows"
|
|
||||||
os: windows
|
|
||||||
language: shell # 'language: python' is an error on Travis CI Windows
|
|
||||||
before_install:
|
|
||||||
- choco install python --version 3.7.5
|
|
||||||
- python -m pip install --upgrade pip
|
|
||||||
- pip --version
|
|
||||||
- pip install poetry~=0.12.17
|
|
||||||
env:
|
|
||||||
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
|
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- python: 3.8
|
- python: 3.8
|
||||||
- python: nightly
|
- python: nightly
|
||||||
- os: windows
|
- os: windows
|
||||||
git:
|
|
||||||
depth: false
|
include:
|
||||||
cache: pip
|
# Python 3.6 Tests
|
||||||
before_install:
|
- name: Python 3.6 on Linux
|
||||||
- date
|
python: 3.6
|
||||||
- pip install poetry~=0.12.17
|
- <<: *test_mac
|
||||||
install:
|
name: Python 3.6 on MacOS
|
||||||
# we run `poetry version` here to appease poetry about '0.0.0-source'
|
python: 3.6
|
||||||
- poetry version
|
env:
|
||||||
- poetry install
|
- JRNL_PYTHON_VERSION=3.6.8
|
||||||
- poetry run python --version
|
- <<: *test_windows
|
||||||
script:
|
name: Python 3.6 on Windows
|
||||||
- poetry run behave
|
python: 3.6
|
||||||
before_deploy:
|
env:
|
||||||
- poetry config http-basic.pypi $PYPI_USER $PYPI_PASS
|
- JRNL_PYTHON_VERSION=3.6.8
|
||||||
- poetry version $TRAVIS_TAG
|
- PATH=/c/Python36:/c/Python36/Scripts:$PATH
|
||||||
- poetry build
|
|
||||||
deploy:
|
# Python 3.7 Tests
|
||||||
- provider: script
|
- name: Python 3.7 on Linux
|
||||||
script: poetry publish
|
python: 3.7
|
||||||
skip_cleanup: true
|
- <<: *test_mac
|
||||||
on:
|
name: Python 3.7 on MacOS
|
||||||
branch: master
|
python: 3.7
|
||||||
tags: true
|
env:
|
||||||
after_deploy:
|
- JRNL_PYTHON_VERSION=3.7.5
|
||||||
- git config --global user.email "jrnl.bot@gmail.com"
|
- <<: *test_windows
|
||||||
- git config --global user.name "Jrnl Bot"
|
name: Python 3.7 on Windows
|
||||||
- git checkout master
|
python: 3.7
|
||||||
- git add pyproject.toml
|
env:
|
||||||
- git commit -m "Incrementing version to ${TRAVIS_TAG}"
|
- JRNL_PYTHON_VERSION=3.7.5
|
||||||
- git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master
|
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
|
||||||
|
|
||||||
|
# Python 3.8 Tests
|
||||||
|
- name: Python 3.8 on Linux
|
||||||
|
python: 3.8
|
||||||
|
- <<: *test_mac
|
||||||
|
name: Python 3.8 on MacOS
|
||||||
|
python: 3.8
|
||||||
|
env:
|
||||||
|
- JRNL_PYTHON_VERSION=3.8.0
|
||||||
|
- <<: *test_windows
|
||||||
|
name: Python 3.8 on Windows
|
||||||
|
python: 3.8
|
||||||
|
env:
|
||||||
|
- JRNL_PYTHON_VERSION=3.8.0
|
||||||
|
- PATH=/c/Python38:/c/Python38/Scripts:$PATH
|
||||||
|
|
||||||
|
# ... and beyond!
|
||||||
|
- name: Python nightly on Linux
|
||||||
|
python: nightly
|
||||||
|
|
||||||
|
# Specialty tests
|
||||||
|
- name: Python 3.7 on Linux, not UTC
|
||||||
|
python: 3.7
|
||||||
|
env:
|
||||||
|
- TZ=America/Edmonton
|
||||||
|
|
||||||
|
- stage: Deploy
|
||||||
|
if: branch = master AND tag IS present
|
||||||
|
before_deploy:
|
||||||
|
- poetry config http-basic.pypi "$PYPI_USER" "$PYPI_PASS"
|
||||||
|
- poetry version "$TRAVIS_TAG"
|
||||||
|
- poetry build
|
||||||
|
deploy:
|
||||||
|
- provider: script
|
||||||
|
script: poetry publish
|
||||||
|
after_deploy:
|
||||||
|
- git config --global user.email "jrnl.bot@gmail.com"
|
||||||
|
- git config --global user.name "Jrnl Bot"
|
||||||
|
- git checkout master
|
||||||
|
- git add pyproject.toml
|
||||||
|
- git commit -m "Incrementing version to ${TRAVIS_TAG}"
|
||||||
|
- git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue