Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] Update bep009 from master #756

Merged
merged 12 commits into from
Mar 15, 2021
Merged
161 changes: 78 additions & 83 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ jobs:
steps:
- checkout
- run:
name: install dependencies
command: |
pip install --upgrade pip
python -m pip install --upgrade pip
pip install -r requirements.txt
- run:
name: generate docs
Expand All @@ -23,6 +24,7 @@ jobs:
- attach_workspace:
at: ~/build
- run:
name: check links
command: |
if (! git log -1 --pretty=%b | grep REL:) ; then
chmod a+rX -R ~
Expand All @@ -49,114 +51,107 @@ jobs:
- run:
name: install dependencies
command: |
pip3 install -r ../requirements.txt
python -m pip install --upgrade pip
pip install -r ../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: sh build_pdf.sh
command: bash build_pdf.sh
- store_artifacts:
path: bids-spec.pdf
- run:
name: remove pdf version from repo
command: rm bids-spec.pdf

# Auto changelog collector
# Auto changelog collector
github-changelog-generator:
working_directory: ~/build
docker:
- image: ferrarimarco/github-changelog-generator:1.14.3
steps:
- setup_remote_docker:
version: 18.06.0-ce
version: 18.06.0-ce
- checkout
- run:
name: Build changelog
working_directory: ~/build
command: |
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 --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
else
echo "Commit or Release, do nothing"
fi
name: Build changelog
working_directory: ~/build
command: |
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 \
--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
else
echo "Commit or Release, do nothing"
fi
- persist_to_workspace:
root: .
paths: src
root: .
paths: src

# Clear remark test
# Run remark on the auto generated changes.md file
remark:
working_directory: ~
docker:
- image: node:latest
steps:
- checkout
- attach_workspace:
at: ~/build
- run:
name: update-npm
command: |
cd ~
npm install npm@latest
- run:
name: get remark
command: |
cd ~
npm install remark remark-cli
name: install remark and extensions
command: npm install `cat npm-requirements.txt`
- run:
name: get remark styles
command: |
cd ~
cat ~/project/npm-requirements.txt | xargs npm install
- run: # remark the auto generated changes.md
name: remark on autogenerated CHANGES.md
command: |
cd ~/project
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
mkdir ~/project/src/tmp
cat ~/build/src/CHANGES.md
cp ~/build/src/CHANGES.md ~/project/src/CHANGES.md
~/node_modules/.bin/remark ~/project/src/CHANGES.md -o ~/project/src/tmp/CHANGES.md
~/node_modules/.bin/remark ~/project/src/tmp/CHANGES.md --frail
else
echo "Commit or Release, do nothing"
mkdir ~/project/src/tmp
touch ~/project/src/tmp/empty.txt
fi
mkdir ~/project/src/tmp
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
else
echo "Commit or Release, do nothing"
touch ~/project/src/tmp/empty.txt
fi
- persist_to_workspace:
root: ~/project/src
paths: tmp
root: ~/project/src
paths: tmp

# Push built changelog to repo
# Push built changelog to repo
Changelog-bot:
working_directory: ~/build
docker:
- image: circleci/openjdk:8-jdk
steps:
- setup_remote_docker:
version: 17.11.0-ce
version: 17.11.0-ce
- checkout
- attach_workspace:
at: ~/build
at: ~/build
- deploy:
name: Changelog deployment
working_directory: ~/build
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
merge_messsge=$(git log -1 | grep Merge | grep "pull")
PR_number=$(echo $merge_messsge | cut -d ' ' -f 4)
git config credential.helper 'cache --timeout=120'
git config user.email "bids.maintenance@gmail.com"
git config user.name "bids-maintenance"
git add ~/build/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
echo "Commit or Release, do nothing"
fi
name: Changelog deployment
working_directory: ~/build
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
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 "bids.maintenance@gmail.com"
git config user.name "bids-maintenance"
git add ~/build/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
echo "Commit or Release, do nothing"
fi

workflows:
version: 2
Expand All @@ -168,26 +163,26 @@ workflows:
- build_docs
- github-changelog-generator:
filters:
branches:
only: master
branches:
only: master
- remark:
requires:
- github-changelog-generator
- github-changelog-generator
filters:
branches:
only: master
branches:
only: master
- Changelog-bot:
requires:
- remark
- remark
filters:
branches:
only: master
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
- linkchecker
- github-changelog-generator
- remark
- Changelog-bot
7 changes: 3 additions & 4 deletions .github/workflows/markdown_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 10
node-version: 14
- name: Install dependencies
run: npm install `cat npm-requirements.txt`
- name: Run style checks
# try npx: https://stackoverflow.com/a/45164863/5201771
run: npx remark src/*.md src/*/*.md --frail
run: npx remark src/*.md src/*/*.md --frail --rc-path .remarkrc
5 changes: 4 additions & 1 deletion .github/workflows/yml_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ jobs:
- name: Install dependencies
run: pip install yamllint
- name: Lint yml files in src/schema
run: yamllint -f standard src/schema/
# for config, see:
# https://yamllint.readthedocs.io/en/stable/configuration.html#custom-configuration-without-a-config-file
run: |
yamllint -f standard src/schema/ -c .yamllint.yml
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ venvs

pdf_build_src/bids-spec.pdf

# JS/NPM
package-lock.json
package.json
node_modules/

# Python gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
13 changes: 0 additions & 13 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ extends: default

rules:
line-length:
max: 99
max: 120
Loading