Skip to content

Commit 95e6c39

Browse files
authored
Merge pull request #2 from qlient-org/dev
Add deployment
2 parents ea04611 + 092f0ce commit 95e6c39

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

.circleci/config.yml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
# Building and testing the project
66
# Useful when a PR is open, for example
77
build-and-test:
8-
# Our environment, Python 3.6.8
8+
# Our environment, Python 3.7
99
docker:
10-
- image: circleci/python:3.6.8
10+
- image: circleci/python:3.7
1111

1212
# The steps for our build-and-test
1313
steps:
@@ -26,6 +26,7 @@ jobs:
2626
- run:
2727
name: Install Dependencies
2828
command: |
29+
pip install --upgrade poetry
2930
python -m poetry install
3031
3132
# Save's the specified path as a cache. This is the path Poetry uses to install the dependencies
@@ -41,6 +42,26 @@ jobs:
4142
name: Run Pytest, report coverage
4243
command: |
4344
python -m poetry run coverage run --omit="/home/circleci/.cache/pypoetry/virtualenvs" -m pytest
45+
python -m poetry run coverage report
46+
47+
# This is the definition of another job, the one we use to publish the package to PyPI
48+
deployment:
49+
50+
# Same environment
51+
docker:
52+
- image: circleci/python:3.7
53+
54+
steps:
55+
56+
# Gets the code
57+
- checkout
58+
59+
# Use `poetry publish` to Publish the package using username and password from CircleCI environment variables
60+
# Which can be configured inside CircleCI's interface
61+
- run:
62+
name: Push to PyPI
63+
command: |
64+
poetry publish --build --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction
4465
4566
# In the workflows section, we specify when we want to run the jobs defined
4667
workflows:
@@ -49,4 +70,26 @@ workflows:
4970
# The build-and-test we will run EVERYTIME a piece of code changes
5071
build-and-test-workflow:
5172
jobs:
52-
- build-and-test
73+
- build-and-test
74+
75+
# The deployment workflow publishes the package
76+
deployment-workflow:
77+
jobs:
78+
79+
# Runs build and test, but now just on Git tags (created from a GitHub release)
80+
- build-and-test:
81+
filters:
82+
tags:
83+
only: /v[0-9]+(\.[0-9]+)*/
84+
branches:
85+
ignore: /.*/
86+
87+
# Runs the deployment job, just with the tags as well
88+
- deployment:
89+
requires:
90+
- build-and-test
91+
filters:
92+
tags:
93+
only: /v[0-9]+(\.[0-9]+)*/
94+
branches:
95+
ignore: /.*/

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ classifiers = [
1616
"Natural Language :: English",
1717
"Intended Audience :: Developers",
1818
"Programming Language :: Python",
19-
"Programming Language :: Python :: 3.6",
2019
"Programming Language :: Python :: 3.7",
2120
"Programming Language :: Python :: 3.8",
2221
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)