|
| 1 | +# |
| 2 | +version: 2.1 |
| 3 | +orbs: |
| 4 | + |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + docker: |
| 9 | + - image: circleci/python:3.7-node |
| 10 | + steps: |
| 11 | + - checkout |
| 12 | + - restore_cache: |
| 13 | + keys: |
| 14 | + - poetry-cache-{{ checksum "poetry.lock" }} |
| 15 | + - run: |
| 16 | + name: Install Tools |
| 17 | + command: | |
| 18 | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python |
| 19 | + - run: |
| 20 | + name: Build |
| 21 | + command: | |
| 22 | + source $HOME/.poetry/env |
| 23 | + poetry install |
| 24 | + poetry run poetry-dynamic-versioning |
| 25 | + poetry build |
| 26 | + - save_cache: |
| 27 | + key: poetry-cache-{{ checksum "poetry.lock" }} |
| 28 | + paths: |
| 29 | + - ~/.cache/poetry |
| 30 | + - store_artifacts: |
| 31 | + path: dist |
| 32 | + - store_artifacts: |
| 33 | + path: output |
| 34 | + - persist_to_workspace: |
| 35 | + # Must be an absolute path, or relative path from working_directory. This is a directory on the container which is |
| 36 | + # taken to be the root directory of the workspace. |
| 37 | + root: . |
| 38 | + # Must be relative path from root |
| 39 | + paths: |
| 40 | + - dist |
| 41 | + - output |
| 42 | + |
| 43 | + test: |
| 44 | + docker: |
| 45 | + - image: circleci/python:3.7-node |
| 46 | + steps: |
| 47 | + - checkout |
| 48 | + - attach_workspace: |
| 49 | + at: /tmp/workspace |
| 50 | + - run: |
| 51 | + name: Install Tools |
| 52 | + command: | |
| 53 | + pip install /tmp/workspace/dist/* |
| 54 | + publish: |
| 55 | + docker: |
| 56 | + - image: circleci/python:3.7-node |
| 57 | + steps: |
| 58 | + - checkout |
| 59 | + - restore_cache: |
| 60 | + keys: |
| 61 | + - poetry-cache-{{ checksum "poetry.lock" }} |
| 62 | + - run: |
| 63 | + name: Install Tools |
| 64 | + command: | |
| 65 | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python |
| 66 | + - run: |
| 67 | + name: Build |
| 68 | + command: | |
| 69 | + source $HOME/.poetry/env |
| 70 | + export PATH=~/.npm-global/bin:$PATH |
| 71 | + poetry install |
| 72 | + poetry run poetry-dynamic-versioning |
| 73 | + poetry publish --build -u $TWINE_USERNAME -p $TWINE_PASSWORD |
| 74 | + - save_cache: |
| 75 | + key: poetry-cache-{{ checksum "poetry.lock" }} |
| 76 | + paths: |
| 77 | + - ~/.poetry |
| 78 | + - store_artifacts: |
| 79 | + path: dist |
| 80 | + - store_artifacts: |
| 81 | + path: output |
| 82 | + - persist_to_workspace: |
| 83 | + # Must be an absolute path, or relative path from working_directory. This is a directory on the container which is |
| 84 | + # taken to be the root directory of the workspace. |
| 85 | + root: . |
| 86 | + # Must be relative path from root |
| 87 | + paths: |
| 88 | + - dist |
| 89 | + - output |
| 90 | + tag: |
| 91 | + parameters: |
| 92 | + semtag: |
| 93 | + type: string |
| 94 | + docker: |
| 95 | + - image: circleci/python:3.7 |
| 96 | + environment: |
| 97 | + SEMTAG: "<< parameters.semtag >>" |
| 98 | + steps: |
| 99 | + - checkout |
| 100 | + - add_ssh_keys: |
| 101 | + fingerprints: |
| 102 | + - "14:2e:73:04:b0:3d:21:7d:bb:c5:79:51:f9:52:b2:22" |
| 103 | + - checkout |
| 104 | + - run: |
| 105 | + name: TAG |
| 106 | + command: | |
| 107 | + ./semtag ${SEMTAG} -f |
| 108 | +
|
| 109 | + merge-beta-to-master: |
| 110 | + docker: |
| 111 | + - image: circleci/python:3.7 |
| 112 | + steps: |
| 113 | + - checkout |
| 114 | + - add_ssh_keys: |
| 115 | + fingerprints: |
| 116 | + - "7c:e9:cc:8d:8e:4d:9c:17:1d:e3:96:23:ce:bd:a4:c3" |
| 117 | + - checkout |
| 118 | + - run: |
| 119 | + name: Merge |
| 120 | + command: | |
| 121 | + git config --global user.email "[email protected]" |
| 122 | + git config --global user.name "Add on release service" |
| 123 | + git pull origin master |
| 124 | + git merge master -m "Merge from master" |
| 125 | + git checkout master |
| 126 | + git merge << pipeline.git.revision >> |
| 127 | + git push |
| 128 | +workflows: |
| 129 | + version: 2 |
| 130 | + build_test: |
| 131 | + jobs: |
| 132 | + - build |
| 133 | + - test: |
| 134 | + requires: |
| 135 | + - build |
| 136 | + - approval-tag-alpha: |
| 137 | + requires: |
| 138 | + - test |
| 139 | + type: approval |
| 140 | + filters: |
| 141 | + branches: |
| 142 | + only: develop |
| 143 | + - tag: |
| 144 | + name: tag-alpha |
| 145 | + requires: |
| 146 | + - approval-tag-alpha |
| 147 | + semtag: a |
| 148 | + release: |
| 149 | + jobs: |
| 150 | + - publish: |
| 151 | + filters: |
| 152 | + branches: |
| 153 | + ignore: /.*/ |
| 154 | + tags: |
| 155 | + only: /^v\d*\.\d*\.\d*.*$/ |
| 156 | + - approval-tag-beta: |
| 157 | + requires: |
| 158 | + - publish |
| 159 | + type: approval |
| 160 | + filters: |
| 161 | + branches: |
| 162 | + ignore: /.*/ |
| 163 | + tags: |
| 164 | + only: /^v\d*\.\d*\.\d*-a\..*$/ |
| 165 | + - tag: |
| 166 | + name: tag-beta |
| 167 | + semtag: b |
| 168 | + requires: |
| 169 | + - approval-tag-beta |
| 170 | + filters: |
| 171 | + branches: |
| 172 | + ignore: /.*/ |
| 173 | + tags: |
| 174 | + only: /^v\d*\.\d*\.\d*-a\..*$/ |
| 175 | + - approval-merge-beta-to-master: |
| 176 | + requires: |
| 177 | + - publish |
| 178 | + type: approval |
| 179 | + filters: |
| 180 | + branches: |
| 181 | + ignore: /.*/ |
| 182 | + tags: |
| 183 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
| 184 | + - merge-beta-to-master: |
| 185 | + requires: |
| 186 | + - approval-merge-beta-to-master |
| 187 | + filters: |
| 188 | + branches: |
| 189 | + ignore: /.*/ |
| 190 | + tags: |
| 191 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
| 192 | + - approval-tag-final-major: |
| 193 | + type: approval |
| 194 | + requires: |
| 195 | + - merge-beta-to-master |
| 196 | + filters: |
| 197 | + branches: |
| 198 | + ignore: /.*/ |
| 199 | + tags: |
| 200 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
| 201 | + - tag: |
| 202 | + name: tag-final-major |
| 203 | + semtag: "final -s major" |
| 204 | + requires: |
| 205 | + - approval-tag-final-major |
| 206 | + filters: |
| 207 | + branches: |
| 208 | + ignore: /.*/ |
| 209 | + tags: |
| 210 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
| 211 | + - approval-tag-final-minor: |
| 212 | + type: approval |
| 213 | + requires: |
| 214 | + - merge-beta-to-master |
| 215 | + filters: |
| 216 | + branches: |
| 217 | + ignore: /.*/ |
| 218 | + tags: |
| 219 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
| 220 | + - tag: |
| 221 | + name: tag-final-minor |
| 222 | + semtag: "final -s minor" |
| 223 | + requires: |
| 224 | + - approval-tag-final-minor |
| 225 | + filters: |
| 226 | + branches: |
| 227 | + ignore: /.*/ |
| 228 | + tags: |
| 229 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
| 230 | + - approval-tag-final-patch: |
| 231 | + type: approval |
| 232 | + requires: |
| 233 | + - merge-beta-to-master |
| 234 | + filters: |
| 235 | + branches: |
| 236 | + ignore: /.*/ |
| 237 | + tags: |
| 238 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
| 239 | + - tag: |
| 240 | + name: tag-final-patch |
| 241 | + semtag: "final -s patch" |
| 242 | + requires: |
| 243 | + - approval-tag-final-patch |
| 244 | + filters: |
| 245 | + branches: |
| 246 | + ignore: /.*/ |
| 247 | + tags: |
| 248 | + only: /^v\d*\.\d*\.\d*-b\..*$/ |
0 commit comments