.gitlab-ci.yml 1.7 KB
Newer Older
Mijian Xu's avatar
Mijian Xu 已提交
1
2
3
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
Mijian Xu's avatar
Mijian Xu 已提交
4
5
6
7
8
image: continuumio/miniconda3:latest

# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
Mijian Xu's avatar
Mijian Xu 已提交
9
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
Mijian Xu's avatar
Mijian Xu 已提交
10
11
12
13
14
15

# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
Mijian Xu's avatar
Mijian Xu 已提交
16
17
18
19

variables:
    TWINE_USERNAME: xumi1993
    TWINE_PASSWORD: Nanwai99
Mijian Xu's avatar
Mijian Xu 已提交
20
21

before_script:
Mijian Xu's avatar
Mijian Xu 已提交
22
  - conda config --set always_yes yes
Mijian Xu's avatar
Mijian Xu 已提交
23
  - conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
Mijian Xu's avatar
Mijian Xu 已提交
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  - conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - conda config --add channels conda-forge
  # - conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
  - pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  - conda info -a

# test:
#   script:
#     - python setup.py test
#     - pip install tox flake8  # you can also use tox
#     - tox -e py36,flake8

py37:
  script:
Mijian Xu's avatar
Mijian Xu 已提交
38
39
    - conda create -n testenv37 python=3.7
    - source activate testenv37
Mijian Xu's avatar
Mijian Xu 已提交
40
    - pip install twine setuptools wheel
Mijian Xu's avatar
Mijian Xu 已提交
41
    - python setup.py sdist bdist_wheel
Mijian Xu's avatar
Mijian Xu 已提交
42
43
    # an alternative approach is to install and run:
    # run the command here
Mijian Xu's avatar
Mijian Xu 已提交
44
45
46
47
48

py36:
  script:
    - conda create -n testenv36 python=3.6
    - source activate testenv36
Mijian Xu's avatar
Mijian Xu 已提交
49
    - pip install twine setuptools wheel
Mijian Xu's avatar
Mijian Xu 已提交
50
51
52
    - python setup.py sdist bdist_wheel
    
after_script:
Mijian Xu's avatar
Mijian Xu 已提交
53
    - twine upload dist/*
Mijian Xu's avatar
Mijian Xu 已提交
54