@@ -2,7 +2,7 @@ version: 2.1
22jobs :
33 build_docs :
44 docker :
5- - image : cimg/python:3.8
5+ - image : cimg/python:3.12-node
66 steps :
77 # checkout code to default ~/project
88 - checkout
@@ -21,14 +21,15 @@ jobs:
2121 - persist_to_workspace :
2222 # the mkdocs build outputs are in ~/project/site
2323 root : ~/project
24- paths : site
24+ paths :
25+ - site
2526 - store_artifacts :
2627 path : ~/project/site/
2728 destination : dev_docs
2829
2930 check_links :
3031 docker :
31- - image : cimg/python:3.8
32+ - image : cimg/python:3.12
3233 steps :
3334 # checkout code to default ~/project
3435 - checkout
@@ -92,132 +93,11 @@ jobs:
9293 - store_artifacts :
9394 path : bids-spec.pdf
9495
95- # Automatically generate a changelog since migration from Google Docs to GitHub
96- github_changelog_generator :
97- docker :
98- - image : ferrarimarco/github-changelog-generator:1.14.3
99- steps :
100- - setup_remote_docker :
101- version : 18.06.0-ce
102- # checkout code to default ~/project
103- - checkout
104- - run :
105- name : Build changelog
106- # $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI
107- command : |
108- mkdir ~/changelog_build
109- git status
110- if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
111- github_changelog_generator \
112- --exclude-tags-regex "^(?!v).*?$" \
113- --user bids-standard \
114- --project bids-specification \
115- --token ${CHANGE_TOKEN} \
116- --output ~/changelog_build/CHANGES.md \
117- --base ~/project/src/pregh-changes.md \
118- --header-label "# Changelog" \
119- --release-branch master \
120- --no-issues \
121- --no-filter-by-milestone \
122- --no-compare-link \
123- --pr-label "" \
124- --enhancement-label "" \
125- --bugs-label "" \
126- --exclude-labels "exclude-from-changelog"
127- cat ~/changelog_build/CHANGES.md
128- else
129- echo "Commit or Release, do nothing"
130- fi
131- - persist_to_workspace :
132- # raw generated changelog in ~/changelog_build/CHANGES.md
133- root : ~/.
134- paths : changelog_build
135-
136- # Lint and fix the auto generated changes.md file
137- lint_generated_changelog :
138- docker :
139- - image : cimg/node:lts
140- steps :
141- # checkout code to default ~/project
142- - checkout
143- - attach_workspace :
144- # the freshly built CHANGES.md will be in ~/changelog_build/CHANGES.md
145- at : ~/.
146- - run :
147- name : install remark and extensions
148- command : npm install `cat npm-requirements.txt`
149- - run :
150- name : remark on autogenerated CHANGES.md
151- # format changelog, then use sed to change * to -, then lint changelog
152- command : |
153- git status
154- if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
155- head -n 100 ~/changelog_build/CHANGES.md
156- npx remark-cli ~/changelog_build/CHANGES.md --rc-path ~/project/.remarkrc --output ~/changelog_build/CHANGES.md
157- head -n 100 ~/changelog_build/CHANGES.md
158- sed -i 's/* /- /' ~/changelog_build/CHANGES.md
159- head -n 100 ~/changelog_build/CHANGES.md
160- npx remark-cli ~/changelog_build/CHANGES.md --frail --rc-path ~/project/.remarkrc
161- else
162- echo "Commit or Release, do nothing"
163- fi
164- - persist_to_workspace :
165- # linted and fixed changelog in ~/changelog_build/CHANGES.md
166- root : ~/.
167- paths : changelog_build
168-
169- # Push built changelog to repo
170- commit_generated_changelog :
171- docker :
172- - image : cimg/base:stable
173- steps :
174- - setup_remote_docker :
175- version : 17.11.0-ce
176- # checkout code to default ~/project
177- - checkout
178- - attach_workspace :
179- # fixed+linted changelog in ~/changelog_build/CHANGES.md
180- at : ~/.
181- - deploy :
182- name : Changelog deployment
183- # $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI
184- command : |
185- if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
186- mv ~/changelog_build/CHANGES.md ~/project/src/CHANGES.md
187- merge_message=$(git log -1 | grep Merge | grep "pull")
188- PR_number=$(echo $merge_message | cut -d ' ' -f 4)
189- git config credential.helper 'cache --timeout=120'
190- git config user.email "bids.maintenance@gmail.com"
191- git config user.name "bids-maintenance"
192- git add ~/project/src/CHANGES.md
193- git commit -m "[DOC] Auto-generate changelog entry for PR ${PR_number}"
194- git push https://${CHANGE_TOKEN}@github.com/bids-standard/bids-specification.git master
195- else
196- echo "Commit or Release, do nothing"
197- fi
198-
19996workflows :
200- version : 2
20197 search_build :
20298 jobs :
20399 - build_docs
204100 - check_links :
205101 requires :
206102 - build_docs
207- - github_changelog_generator :
208- filters :
209- branches :
210- only : master
211- - lint_generated_changelog :
212- requires :
213- - github_changelog_generator
214- filters :
215- branches :
216- only : master
217- - commit_generated_changelog :
218- requires :
219- - lint_generated_changelog
220- filters :
221- branches :
222- only : master
223103 - build_docs_pdf
0 commit comments