@@ -20,10 +20,20 @@ defaults: &defaults
2020 - run :
2121 name : Version checks
2222 command : |
23- grep -q $VERSION notebooker/_version .py || (echo "ERROR: Version number not found in notebooker/_version.py: $VERSION"; exit 1)
23+ grep -q $VERSION notebooker/version .py || (echo "ERROR: Version number not found in notebooker/_version.py: $VERSION"; exit 1)
2424 grep -q $VERSION CHANGELOG.md || (echo "ERROR: Version number not found in CHANGES.md: $VERSION"; exit 1)
2525 grep -q $VERSION docs/conf.py || (echo "ERROR: Version number not found in docs/source/conf.py: $VERSION"; exit 1)
2626 grep -q $VERSION notebooker/web/static/package.json || (echo "ERROR: Version number not found in package.json: $VERSION"; exit 1)
27+ - run :
28+ name : Output useful stuff
29+ command : |
30+ echo $VERSION > "$CIRCLE_ARTIFACTS/version.txt"
31+ # Find the lines of the changelog between releases, escape double quotes, delete empty lines
32+ sed -n '{ /------/= }' CHANGELOG.md \
33+ | head -n 2 \
34+ | xargs -n 2 bash -c 'sed -n "s/\"/\\\\\"/g;`expr $0 + 1`,`expr $1 - 2`p" CHANGELOG.md' \
35+ | sed '/^$/d' \
36+ > "$CIRCLE_ARTIFACTS/changes.md"
2737 - run :
2838 name : Install MongoDB
2939 command : |
@@ -136,10 +146,6 @@ defaults: &defaults
136146 python setup.py sdist
137147 mkdir -p "$CIRCLE_ARTIFACTS/dist"
138148 cp -r ./dist/* "$CIRCLE_ARTIFACTS/dist"
139- - run :
140- name : Upload to PyPI
141- command : |
142- echo $VERSION > "$CIRCLE_ARTIFACTS/version.txt"
143149 - run :
144150 name : Upload to PyPI
145151 command : |
@@ -162,6 +168,7 @@ defaults: &defaults
162168 root : /tmp/circleci-artifacts
163169 paths :
164170 - ./*/version.txt
171+ - ./*/changes.md
165172 - ./*/dist/*
166173version : 2
167174jobs :
@@ -170,7 +177,7 @@ jobs:
170177 PYTHON_VERSION : " 3_6"
171178 CIRCLE_ARTIFACTS : /tmp/circleci-artifacts/3_6
172179 CIRCLE_TEST_REPORTS : /tmp/circleci-test-results/3_6
173- VERSION : 0.2.1
180+ VERSION : 0.3.0
174181 PANDOC_RELEASES_URL : https://github.com/jgm/pandoc/releases
175182 YARN_STATIC_DIR : notebooker/web/static/
176183 IMAGE_NAME : mangroup/notebooker
@@ -182,7 +189,7 @@ jobs:
182189 environment :
183190 CIRCLE_ARTIFACTS : /tmp/circleci-artifacts/3_7
184191 CIRCLE_TEST_REPORTS : /tmp/circleci-test-results/3_7
185- VERSION : 0.2.1
192+ VERSION : 0.3.0
186193 PANDOC_RELEASES_URL : https://github.com/jgm/pandoc/releases
187194 YARN_STATIC_DIR : notebooker/web/static/
188195 IMAGE_NAME : mangroup/notebooker
@@ -200,7 +207,15 @@ jobs:
200207 name : " Publish release on GitHub"
201208 command : |
202209 VERSION=$(cat /tmp/circleci-artifacts/3_6/version.txt)
203- ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -soft ${VERSION} /tmp/circleci-artifacts/3_6/dist
210+ CHANGES=$(cat /tmp/circleci-artifacts/3_6/changes.md)
211+ ghr -t ${GITHUB_TOKEN} \
212+ -u ${CIRCLE_PROJECT_USERNAME} \
213+ -r ${CIRCLE_PROJECT_REPONAME} \
214+ -c ${CIRCLE_SHA1} \
215+ -n ${VERSION} \
216+ -b "${CHANGES}" \
217+ -soft \
218+ ${VERSION} /tmp/circleci-artifacts/3_6/dist
204219workflows :
205220 version : 2
206221 build_all :
0 commit comments