Skip to content

Commit

Permalink
Merge branch 'bids-standard:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
markmikkelsen authored Jun 1, 2024
2 parents a98700e + 70d7750 commit 231304e
Show file tree
Hide file tree
Showing 18 changed files with 163 additions and 154 deletions.
121 changes: 0 additions & 121 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,132 +93,11 @@ jobs:
- store_artifacts:
path: bids-spec.pdf

# Automatically generate a changelog since migration from Google Docs to GitHub
github_changelog_generator:
docker:
- image: ferrarimarco/github-changelog-generator:1.14.3
steps:
- setup_remote_docker:
version: 18.06.0-ce
# checkout code to default ~/project
- checkout
- run:
name: Build changelog
# $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 \
--exclude-tags-regex "^(?!v).*?$" \
--user bids-standard \
--project bids-specification \
--token ${CHANGE_TOKEN} \
--output ~/changelog_build/CHANGES.md \
--base ~/project/src/pregh-changes.md \
--header-label "# Changelog" \
--release-branch master \
--no-issues \
--no-filter-by-milestone \
--no-compare-link \
--pr-label "" \
--enhancement-label "" \
--bugs-label "" \
--exclude-labels "exclude-from-changelog"
cat ~/changelog_build/CHANGES.md
else
echo "Commit or Release, do nothing"
fi
- persist_to_workspace:
# raw generated changelog in ~/changelog_build/CHANGES.md
root: ~/.
paths:
- changelog_build

# Lint and fix the auto generated changes.md file
lint_generated_changelog:
docker:
- image: cimg/node:lts
steps:
# checkout code to default ~/project
- checkout
- attach_workspace:
# 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: |
git status
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
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"
fi
- persist_to_workspace:
# linted and fixed changelog in ~/changelog_build/CHANGES.md
root: ~/.
paths:
- changelog_build

# Push built changelog to repo
commit_generated_changelog:
docker:
- image: cimg/base:stable
steps:
- setup_remote_docker
# checkout code to default ~/project
- checkout
- attach_workspace:
# fixed+linted changelog in ~/changelog_build/CHANGES.md
at: ~/.
- run:
name: Changelog deployment
# $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 ~/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 ~/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
echo "Commit or Release, do nothing"
fi
workflows:
search_build:
jobs:
- build_docs
- check_links:
requires:
- build_docs
- github_changelog_generator:
filters:
branches:
only: master
- lint_generated_changelog:
requires:
- github_changelog_generator
filters:
branches:
only: master
- commit_generated_changelog:
requires:
- lint_generated_changelog
filters:
branches:
only: master
- build_docs_pdf
130 changes: 130 additions & 0 deletions .github/workflows/changelog_generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
name: GitHub_Changelog_Generator

on:
push:
branches: ["master"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
github_changelog_generator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Install dependencies
run: |
gem install github_changelog_generator
- name: Check version
run: |
github_changelog_generator --version
- name: Build changelog
run: |
mkdir ~/changelog_build
github_changelog_generator \
--exclude-tags-regex "^(?!v).*?$" \
--user bids-standard \
--project bids-specification \
--token ${{ secrets.GITHUB_TOKEN }} \
--output ~/changelog_build/CHANGES.md \
--header-label "# Changelog" \
--release-branch master \
--no-issues \
--no-filter-by-milestone \
--no-compare-link \
--pr-label "" \
--enhancement-label "" \
--bugs-label "" \
--exclude-labels "exclude-from-changelog"
- name: Append changelog from pre-GitHub times
run: |
cat ${{ github.workspace }}/src/pregh-changes.md >> ~/changelog_build/CHANGES.md
- name: Remove the inserted advert from the file
run: |
sed -i '/This Changelog was automatically generated by/d' ~/changelog_build/CHANGES.md
- name: Print out complete changelog
run: |
cat ~/changelog_build/CHANGES.md
- name: Archive changelog
uses: actions/upload-artifact@v4
with:
name: changelog_pre_lint
path: |
~/changelog_build/CHANGES.md
lint_generated_changelog:
needs: github_changelog_generator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download previously build changelog
uses: actions/download-artifact@v4
with:
name: changelog_pre_lint
path: ~/changelog_build
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install remark and extensions
run: |
npm install `cat npm-requirements.txt`
- name: Remark on autogenerated CHANGES.md
# first remove empty lines
# then run remark to re-organize
# replace remark's bullet list "*" with "-"
# final run of remark to check everything passes now
run: |
head -n 25 ~/changelog_build/CHANGES.md
sed -i '/^$/d' ~/changelog_build/CHANGES.md
echo $'\n------------------------------\n'
head -n 25 ~/changelog_build/CHANGES.md
npx remark ~/changelog_build/CHANGES.md --rc-path ${{ github.workspace }}/.remarkrc --output ~/changelog_build/CHANGES.md --quiet
echo $'\n------------------------------\n'
head -n 25 ~/changelog_build/CHANGES.md
sed -i 's/^* /- /' ~/changelog_build/CHANGES.md
echo $'\n------------------------------\n'
head -n 25 ~/changelog_build/CHANGES.md
npx remark ~/changelog_build/CHANGES.md --rc-path ${{ github.workspace }}/.remarkrc --frail --quiet --no-stdout
- name: Archive linted changelog
uses: actions/upload-artifact@v4
with:
name: changelog_post_lint
path: |
~/changelog_build/CHANGES.md
commit_generated_changelog:
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
needs: lint_generated_changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download previously build changelog
uses: actions/download-artifact@v4
with:
name: changelog_post_lint
path: ~/changelog_build
- name: Changelog deployment
run: |
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
mv ~/changelog_build/CHANGES.md ${{ github.workspace }}/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 ${{ github.workspace }}/src/CHANGES.md
git commit -m "[DOC] Auto-generate changelog entry for PR ${PR_number}"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/bids-standard/bids-specification.git master
else
echo "Did not detect a "Merge commit" to master, or detected a Release ... doing nothing."
fi
4 changes: 2 additions & 2 deletions .github/workflows/schemacode_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: "Upload to PyPI (on tags)"
if: startsWith(github.ref, 'refs/tags/schema-')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 22
- name: Install dependencies
run: npm install `cat npm-requirements.txt`
- name: Run style checks
Expand Down
2 changes: 1 addition & 1 deletion .remarkrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"preset-lint-recommended",
"remark-gfm",
["lint-no-duplicate-headings", false],
["lint-list-item-indent", "tab-size"],
["lint-list-item-indent", "tab"],
["lint-emphasis-marker", "consistent"],
["lint-maximum-line-length", false],
["lint-maximum-heading-length", false],
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,28 +202,28 @@ Don't do this:

```Markdown
| **Key name** | **Description** |
|--------------|----------------------------------------------------------|
| ------------ | -------------------------------------------------------- |
| Manufacturer | Manufacturer of the equipment, for example (`Siemens`) |
```

That would look like this:

| **Key name** | **Description** |
|--------------|----------------------------------------------------------|
| ------------ | -------------------------------------------------------- |
| Manufacturer | Manufacturer of the equipment, for example (`Siemens`) |

But do this instead:

```Markdown
| **Key name** | **Description** |
|--------------|----------------------------------------------------------|
| ------------ | -------------------------------------------------------- |
| Manufacturer | Manufacturer of the equipment, for example (`"Siemens"`) |
```

That would look like this:

| **Key name** | **Description** |
|--------------|----------------------------------------------------------|
| ------------ | -------------------------------------------------------- |
| Manufacturer | Manufacturer of the equipment, for example (`"Siemens"`) |


Expand Down
4 changes: 2 additions & 2 deletions DECISION-MAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Current and past members of the steering group can be found
### Maintainers Group

| Name | Time commitment | Scope | Joined |
|---------------------------------------------------------------------------|-----------------|---------------------------------------|----------|
| ------------------------------------------------------------------------- | --------------- | ------------------------------------- | -------- |
| Stefan Appelhoff ([@sappelhoff](https://github.com/sappelhoff)) | 1h/week | | Mar 2020 |
| Chris Markiewicz ([@effigies](https://github.com/effigies)) | 5h/week | | Mar 2020 |
| Ross Blair ([@rwblair](https://github.com/rwblair)) | | Maintainer of the bids-validator | Mar 2020 |
Expand All @@ -46,7 +46,7 @@ is rotating among current maintainers.
#### Past maintainers group members

| Name | Duration |
|--------------------------------------------------------------------------------|---------------------|
| ------------------------------------------------------------------------------ | ------------------- |
| Franklin Feingold ([@franklin-feingold](https://github.com/franklin-feingold)) | Mar 2020 - Jul 2022 |

### BEP Leads Group
Expand Down
8 changes: 4 additions & 4 deletions npm-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
remark-cli@9.0.0
remark-gfm@1
remark-preset-lint-recommended@5.0.0
remark-preset-lint-markdown-style-guide@4.0.0
remark-cli@12
remark-gfm@4
remark-preset-lint-recommended@7
remark-preset-lint-markdown-style-guide@6
remark-lint-no-trailing-spaces@2
Loading

0 comments on commit 231304e

Please sign in to comment.