Skip to content
This repository was archived by the owner on May 20, 2022. It is now read-only.

Commit 0be3a0b

Browse files
authored
Merge pull request #39 from fyntex/feature/upload-to-pypi-from-ci
config: Add PyPI package uploading to CI
2 parents cd70b91 + 39643a1 commit 0be3a0b

2 files changed

Lines changed: 53 additions & 13 deletions

File tree

.circleci/config.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@
1111
#
1212
version: "2.1"
1313

14+
# -----BEGIN Environment Variables-----
15+
16+
# Environment variables required for deployment:
17+
#
18+
# - PYPI_PASSWORD := PyPI password or API token.
19+
# - PYPI_USERNAME := PyPI username. For API tokens, use "__token__".
20+
# - TWINE_NON_INTERACTIVE := Do not interactively prompt for credentials if they are missing.
21+
# - TWINE_REPOSITORY_URL := The repository (package index) URL to register the package to.
22+
23+
# x-deploy-environment := Deployment environment variables
24+
x-deploy-environment: &x-deploy-environment
25+
TWINE_NON_INTERACTIVE: "true"
26+
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
27+
28+
# -----END Environment Variables-----
29+
1430
jobs:
1531
test:
1632
parameters:
@@ -95,6 +111,35 @@ jobs:
95111
path: dist
96112
destination: dist
97113

114+
- persist_to_workspace:
115+
root: ~/repo
116+
paths:
117+
- dist
118+
- venv
119+
120+
deploy:
121+
docker:
122+
- image: python:3.7.2
123+
environment:
124+
<<: *x-deploy-environment
125+
126+
working_directory: ~/repo
127+
128+
steps:
129+
- checkout
130+
131+
- attach_workspace:
132+
at: ~/repo
133+
134+
- deploy:
135+
name: Upload Artifacts to Repository
136+
command: |
137+
. venv/bin/activate
138+
139+
make upload-release \
140+
TWINE_USERNAME="${PYPI_USERNAME:?}" \
141+
TWINE_PASSWORD="${PYPI_PASSWORD:?}"
142+
98143
workflows:
99144
version: 2
100145
ci:
@@ -107,3 +152,10 @@ workflows:
107152
- "3.8.2" # Ubuntu 20.04 LTS
108153
- "3.8.3" # Latest version
109154
- dist
155+
- deploy:
156+
requires:
157+
- dist
158+
filters:
159+
branches:
160+
only:
161+
- master

docs/project-maintenance.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,7 @@ Push commit ``abcd1234`` and tag ``vX.Y.Z`` automatically created by ``bumpversi
9292

9393
* "Publish release".
9494

95-
4) Publish to PyPI
96-
+++++++++++++++++++
97-
98-
(local workstation)
99-
100-
Run::
101-
102-
make upload-release
103-
make -s clean
104-
105-
Check out the `project's page at PyPI <https://pypi.org/project/fyndata-gcp-utils/>`_.
106-
107-
5) Update ``develop``
95+
4) Update ``develop``
10896
+++++++++++++++++++
10997

11098
(local workstation)

0 commit comments

Comments
 (0)