-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (45 loc) · 1.25 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
image: continuumio/miniconda3
stages:
- package_test
- package_build
- package_deployment
test_package:
stage: package_test
script:
- conda init bash
- source ~/.bashrc
- conda env create -f environment.yaml
- conda activate raster2stac
- pytest tests/
build_package:
stage: package_build
script:
- CURRENT_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
- sed -i "s/SEMANTIC_VERSION/$CURRENT_VERSION/" ${CI_PROJECT_DIR}/pyproject.toml
- sed -i "s/SEMANTIC_VERSION/$CURRENT_VERSION/" ${CI_PROJECT_DIR}/raster2stac/_version.py
- python3 -m pip install --upgrade setuptools>=61.0
- python3 -m pip install --upgrade build
- python3 -m build
artifacts:
paths:
- dist/*
staging_testpypi:
stage: package_deployment
variables:
TWINE_USERNAME: $STAGING_USERNAME
TWINE_PASSWORD: $STAGING_TOKEN
script:
- python3 -m pip install --upgrade twine
- twine upload --repository testpypi dist/*
only:
- tags
production_pypi:
stage: package_deployment
variables:
TWINE_USERNAME: $PRODUCTION_USERNAME
TWINE_PASSWORD: $PRODUCTION_TOKEN
script:
- python3 -m pip install --upgrade twine
- twine upload dist/*
only:
- /^release_(\d+\.)?(\d+\.)?(\*|\d+)$/