-
Notifications
You must be signed in to change notification settings - Fork 23
/
.gitlab-ci.yml
88 lines (80 loc) · 2.55 KB
/
.gitlab-ci.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
image: $IMAGE
stages:
- test
- build
- deploy
.setup_ubuntu: &setup_ubuntu |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq && apt-get install -y -qq \
gcc git make cmake curl wget \
python3-all-dev python3-venv python-is-python3
test-quick:
stage: test
before_script:
- *setup_ubuntu
- apt-get install -y -qq
script:
- make venv
- . ./venv/bin/activate && python setup.py install
- make docs
test-all:
stage: test
before_script:
- *setup_ubuntu
- apt-get install -y -qq
gcc git make cmake curl wget
zlib1g-dev libbz2-dev liblzma-dev libncurses5-dev libcurl4-gnutls-dev
libssl-dev
script:
- make -j 4 install
build:sdist:
stage: build
before_script:
- *setup_ubuntu
script:
- make sdist
artifacts:
paths:
- dist/*.tar.gz
deploy:pypi:
stage: deploy
before_script:
- *setup_ubuntu
script:
- make build
- source pypi_build/bin/activate
- twine upload dist/*.tar.gz
only:
- tags
# Send all tags matching vX.Y.Z to github (code and release)
push-github:
stage: deploy
before_script:
- apt-get update -qq && apt-get install -y -qq
git python3-all-dev git-lfs python3-venv
- mkdir ~/.ssh/
- cp $RESEARCH_BOT_GH_KEY ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n\tHostname ssh.github.com\n\tPort 443\n\n" > ~/.ssh/config
- git config --global user.email "[email protected]"
- git config --global user.name "ontresearch"
script:
# Push master and tag to github
- git remote add ont ${CI_REPOSITORY_URL} || true
- git remote add github [email protected]:nanoporetech/${CI_PROJECT_NAME}.git || true
- git fetch ont dev --tags
- git fetch ont master
- git fetch github master
- git checkout --track github/master || git checkout master
- git merge ${CI_COMMIT_TAG}
- git push github master
- git push github ${CI_COMMIT_TAG}
# Make a github release page
- make build
- source pypi_build/bin/activate
- pip install git+https://github.com/epi2me-labs/github_release.git
- github_release ${CI_PROJECT_NAME} ${CI_COMMIT_TAG} CHANGELOG.md ${RESEARCH_BOT_GH_TOKEN}
--artifacts dist/*.tar.gz
only:
- /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/
except:
- branches