-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into enh/metadata_statement
- Loading branch information
Showing
186 changed files
with
24,501 additions
and
4,482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,63 +2,90 @@ version: 2 | |
jobs: | ||
build_docs: | ||
docker: | ||
- image: circleci/python:3.8 | ||
- image: cimg/python:3.8 | ||
steps: | ||
# checkout code to default ~/project | ||
- checkout | ||
- run: | ||
name: install dependencies | ||
command: | | ||
python -m venv env | ||
source env/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -e ~/project/tools/schemacode/ | ||
- run: | ||
name: generate docs | ||
command: mkdocs build --clean --strict --verbose | ||
command: | | ||
source env/bin/activate | ||
mkdocs build --clean --strict --verbose | ||
- persist_to_workspace: | ||
root: . | ||
# the mkdocs build outputs are in ~/project/site | ||
root: ~/project | ||
paths: site | ||
- store_artifacts: | ||
path: ~/project/site/ | ||
destination: dev_docs | ||
|
||
linkchecker: | ||
docker: | ||
- image: yarikoptic/linkchecker:9.4.0.anchorfix1-1 | ||
- image: cimg/python:3.8 | ||
steps: | ||
# checkout code to default ~/project | ||
- checkout | ||
- attach_workspace: | ||
at: ~/build | ||
# mkdocs build outputs will be in ~/project/site | ||
at: ~/project | ||
- run: | ||
name: install linkchecker | ||
command: | | ||
python -m venv env | ||
source env/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install linkchecker | ||
- run: | ||
name: check links | ||
command: | | ||
if (! git log -1 --pretty=%b | grep REL:) ; then | ||
chmod a+rX -R ~ | ||
linkchecker -t 1 ~/build/site/ | ||
# check external separately by pointing to all *html so no | ||
# failures for local file:/// -- yoh found no better way, | ||
linkchecker -t 1 --check-extern \ | ||
--ignore-url 'file:///.*' \ | ||
--ignore-url https://fonts.gstatic.com \ | ||
--ignore-url "https://github.com/bids-standard/bids-specification/(pull|tree)/.*" \ | ||
--ignore-url "https://github.com/[^/]*" \ | ||
~/build/site/*html ~/build/site/*/*.html | ||
source env/bin/activate | ||
git status | ||
if (! git log -1 --pretty=oneline | grep REL:) ; then | ||
chmod a+rX -R ~ | ||
linkchecker -t 1 ~/project/site/ | ||
# check external separately by pointing to all *html so no | ||
# failures for local file:/// -- yoh found no better way, | ||
linkchecker -t 1 --check-extern \ | ||
--ignore-url 'file:///.*' \ | ||
--ignore-url 'https://fonts.gstatic.com' \ | ||
--ignore-url 'https://github.com/bids-standard/bids-specification/(pull|tree)/.*' \ | ||
--ignore-url 'https://github.com/[^/]*' \ | ||
--ignore-url 'https://doi.org/.*' \ | ||
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \ | ||
~/project/site/*html ~/project/site/*/*.html | ||
else | ||
echo "Release PR - do nothing" | ||
echo "Release PR - do nothing" | ||
fi | ||
build_docs_pdf: | ||
working_directory: ~/bids-specification/pdf_build_src | ||
docker: | ||
- image: danteev/texlive:latest | ||
steps: | ||
- checkout: | ||
path: ~/bids-specification | ||
# checkout code to default ~/project | ||
- checkout | ||
- run: | ||
name: install dependencies | ||
command: | | ||
python -m pip install --upgrade pip | ||
pip install -r ../requirements.txt | ||
apt-get update && apt install -y python3-pip | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r ~/project/requirements.txt | ||
- run: | ||
name: install font that works with unicode emojis | ||
command: apt-get update && apt-get install -y fonts-symbola | ||
- run: | ||
name: generate pdf version docs | ||
command: bash build_pdf.sh | ||
command: | | ||
cd ~/project/pdf_build_src | ||
bash build_pdf.sh | ||
mv ~/project/pdf_build_src/bids-spec.pdf ~/project/bids-spec.pdf | ||
- store_artifacts: | ||
path: bids-spec.pdf | ||
|
||
|
@@ -69,84 +96,94 @@ jobs: | |
steps: | ||
- setup_remote_docker: | ||
version: 18.06.0-ce | ||
# checkout code to default ~/project | ||
- checkout | ||
- run: | ||
name: Build changelog | ||
working_directory: ~/build | ||
# $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI | ||
command: | | ||
mkdir ~/changelog_build | ||
git status | ||
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then | ||
github_changelog_generator \ | ||
--user bids-standard \ | ||
--project bids-specification \ | ||
--token ${CHANGE_TOKEN} \ | ||
--output ~/build/CHANGES.md \ | ||
--base ~/build/src/pregh-changes.md \ | ||
--output ~/changelog_build/CHANGES.md \ | ||
--base ~/project/src/pregh-changes.md \ | ||
--header-label "# Changelog" \ | ||
--no-issues \ | ||
--no-issues-wo-labels \ | ||
--no-filter-by-milestone \ | ||
--no-compare-link \ | ||
--pr-label "" \ | ||
--release-branch master | ||
cat ~/build/CHANGES.md | ||
mv ~/build/CHANGES.md ~/build/src/CHANGES.md | ||
cat ~/changelog_build/CHANGES.md | ||
else | ||
echo "Commit or Release, do nothing" | ||
fi | ||
- persist_to_workspace: | ||
root: . | ||
paths: src | ||
# raw generated changelog in ~/changelog_build/CHANGES.md | ||
root: ~/. | ||
paths: changelog_build | ||
|
||
# Run remark on the auto generated changes.md file | ||
remark: | ||
docker: | ||
- image: node:latest | ||
- image: cimg/node:lts | ||
steps: | ||
# checkout code to default ~/project | ||
- checkout | ||
- attach_workspace: | ||
at: ~/build | ||
# the freshly built CHANGES.md will be in ~/changelog_build/CHANGES.md | ||
at: ~/. | ||
- run: | ||
name: install remark and extensions | ||
command: npm install `cat npm-requirements.txt` | ||
- run: | ||
name: remark on autogenerated CHANGES.md | ||
# format changelog, then use sed to change * to -, then lint changelog | ||
command: | | ||
mkdir ~/project/src/tmp | ||
git status | ||
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then | ||
cat ~/build/src/CHANGES.md | ||
cp ~/build/src/CHANGES.md ~/project/src/tmp/CHANGES.md | ||
npx remark ~/project/src/tmp/CHANGES.md --frail --rc-path .remarkrc | ||
head -n 100 ~/changelog_build/CHANGES.md | ||
npx remark-cli ~/changelog_build/CHANGES.md --rc-path ~/project/.remarkrc --output ~/changelog_build/CHANGES.md | ||
head -n 100 ~/changelog_build/CHANGES.md | ||
sed -i 's/* /- /' ~/changelog_build/CHANGES.md | ||
head -n 100 ~/changelog_build/CHANGES.md | ||
npx remark-cli ~/changelog_build/CHANGES.md --frail --rc-path ~/project/.remarkrc | ||
else | ||
echo "Commit or Release, do nothing" | ||
touch ~/project/src/tmp/empty.txt | ||
fi | ||
- persist_to_workspace: | ||
root: ~/project/src | ||
paths: tmp | ||
# fixed+linted changelog in ~/changelog_build/CHANGES.md | ||
root: ~/. | ||
paths: changelog_build | ||
|
||
# Push built changelog to repo | ||
Changelog-bot: | ||
working_directory: ~/build | ||
docker: | ||
- image: circleci/openjdk:8-jdk | ||
- image: cimg/base:stable | ||
steps: | ||
- setup_remote_docker: | ||
version: 17.11.0-ce | ||
# checkout code to default ~/project | ||
- checkout | ||
- attach_workspace: | ||
at: ~/build | ||
# fixed+linted changelog in ~/changelog_build/CHANGES.md | ||
at: ~/. | ||
- deploy: | ||
name: Changelog deployment | ||
working_directory: ~/build | ||
# $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI | ||
command: | | ||
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then | ||
mv ~/build/tmp/CHANGES.md ~/build/src/CHANGES.md | ||
mv ~/changelog_build/CHANGES.md ~/project/src/CHANGES.md | ||
merge_message=$(git log -1 | grep Merge | grep "pull") | ||
PR_number=$(echo $merge_message | cut -d ' ' -f 4) | ||
git config credential.helper 'cache --timeout=120' | ||
git config user.email "[email protected]" | ||
git config user.name "bids-maintenance" | ||
git add ~/build/src/CHANGES.md | ||
git add ~/project/src/CHANGES.md | ||
git commit -m "[DOC] Auto-generate changelog entry for PR ${PR_number}" | ||
git push https://${CHANGE_TOKEN}@github.com/bids-standard/bids-specification.git master | ||
else | ||
|
@@ -177,12 +214,4 @@ workflows: | |
filters: | ||
branches: | ||
only: master | ||
# Ensure that build_docs_pdf always runs last, so that we can use the CircleCI API link for the "latest" artifact | ||
# https://circleci.com/api/v1.1/project/github/bids-standard/bids-specification/latest/artifacts/0/bids-spec.pdf?branch=master | ||
- build_docs_pdf: | ||
requires: | ||
- build_docs | ||
- linkchecker | ||
- github-changelog-generator | ||
- remark | ||
- Changelog-bot | ||
- build_docs_pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.png -text | ||
*.jpg -text | ||
*.webm -text | ||
tools/schemacode/schemacode/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Codespell | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
codespell: | ||
name: Check for spelling errors | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: codespell-project/actions-codespell@master | ||
with: | ||
skip: js,*.svg | ||
ignore_words_list: fo,te,als |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.