Skip to content

Commit 7def829

Browse files
author
Rami Chowdhury
committed
Attempt to fix CircleCI config
Try to build only on tags, not branch pushes, and ensure that the tag matches the tip of master before we run the deploy.
1 parent b6eca52 commit 7def829

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.circleci/config.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ jobs:
4545
command: |
4646
poetry publish --build --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction
4747
48+
tag_describes_master:
49+
docker:
50+
- image: circleci/python:3.7.3 # includes `poetry`!
51+
steps:
52+
- run:
53+
name: Check that the tag being built is at the tip of master
54+
command: |
55+
[ "$(git describe master)" = "$CIRCLE_TAG" ]
56+
4857
# When to run which job
4958
workflows:
5059
version: 2.1
@@ -54,21 +63,22 @@ workflows:
5463
- build
5564

5665
# The deployment workflow publishes the package, and is only run on a Git tag matching a
57-
# version regex being merged to master
66+
# version regex that exists on master
5867
deployment-workflow:
5968
jobs:
6069
- build:
6170
filters:
6271
tags:
6372
only: /v[0-9]+(\.[0-9]+)*/
6473
branches:
65-
only: master
74+
ignore: /.*/
6675

6776
- deployment:
6877
requires:
6978
- build
79+
- tag_describes_master
7080
filters:
7181
tags:
7282
only: /v[0-9]+(\.[0-9]+)*/
7383
branches:
74-
only: master
84+
ignore: /.*/

0 commit comments

Comments
 (0)