forked from bids-standard/bids-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'v1.10.0-35-g5f7004819' (master) into enh-project-datase…
…ttype * commit 'v1.10.0-35-g5f7004819': (218 commits) Include entity-less "scans.json" into an example of inheritance principle (bids-standard#1945) fix(checks): Enforce timing mutual exclusions on BOLD/ASL data only (bids-standard#1969) refactor contributing (bids-standard#1965) [pre-commit.ci] pre-commit autoupdate (bids-standard#1967) [SCHEMA] Allow physio files for anat datatype (bids-standard#1961) [pre-commit.ci] pre-commit autoupdate Add an empty line in hope to get table rendered properly in "Ordering rules" section (bids-standard#1953) schema: add check for duplicate READMEs (bids-standard#1952) [MAINT] switch bidsschematools to pyproject.toml (bids-standard#1948) fix(schema): Disable TaskName check for channels and markers files Permit and warn on task/acquisition/run for electrodes and coordsystems [FIX] Allow (but discourage) task entity for coordsystem.json fix(schema): Limit MRI metadata checks to NIfTIs fix: Only check for sorted times in arrays py3.13 (bids-standard#1947) [pre-commit.ci] pre-commit autoupdate (bids-standard#1946) [FIX] Update changelog links to avoid redirects (bids-standard#1944) [ENH] Update DWI suffixes to include most common scanner derivatives (bids-standard#1864) [pre-commit.ci] pre-commit autoupdate [MAINT] Update Release_Protocol.md ...
- Loading branch information
Showing
113 changed files
with
3,977 additions
and
2,064 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: "Publish schema" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
GIT_AUTHOR_NAME: BIDS CI | ||
GIT_AUTHOR_EMAIL: bids.maintenance@gmail.com | ||
GIT_COMMITTER_NAME: BIDS CI | ||
GIT_COMMITTER_EMAIL: bids.maintenance@gmail.com | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
filter: "blob:none" | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3 | ||
- name: Install bidsschematools | ||
run: | | ||
pip install --upgrade tools/schemacode | ||
git clean -fxd tools/schemacode | ||
- name: Checkout jsr-dist | ||
run: | | ||
git checkout -t origin/jsr-dist | ||
- name: Regenerate schema | ||
run: bst export > schema.json | ||
- name: Regenerate context types | ||
run: | | ||
jq .meta.context schema.json \ | ||
| npx quicktype --src-lang schema --lang ts -t Context --just-types \ | ||
> context.ts | ||
- name: Regenerate metaschema types | ||
run: | | ||
# Name the file schema so the type will be named Schema | ||
bst export-metaschema > /tmp/schema.json | ||
npx --package=json-schema-to-typescript json2ts --unknownAny /tmp/schema.json > metaschema.ts | ||
- name: Determine next version | ||
run: | | ||
BASE=$( jq -r .schema_version schema.json ) | ||
if [[ "$BASE" =~ ^[0-9]*.[0-9]*.[0-9]*$ ]]; then | ||
# Release, so unconditionally update version | ||
VERSION=$BASE | ||
jq ".version = \"$VERSION\"" jsr.json > tmp.json && mv tmp.json jsr.json | ||
else | ||
DENOVER=$( jq -r .version jsr.json ) | ||
# Get the reference of the latest commit to touch the schema directory | ||
HASH=$( git log -n 1 --pretty=%h $REF -- src/schema ) | ||
if [[ $DENOVER =~ ^"$BASE".[0-9] ]]; then | ||
PREFIX=${DENOVER%+*} | ||
let SERIAL=1+${PREFIX#$BASE.} | ||
else | ||
SERIAL=1 | ||
fi | ||
VERSION="$BASE.$SERIAL+$HASH" | ||
fi | ||
echo VERSION=$VERSION | tee -a $GITHUB_ENV | ||
env: | ||
REF: ${{ github.ref }} | ||
- name: Check for changes, set version and commit | ||
run: | | ||
if ! git diff -s --exit-code; then | ||
jq ".version = \"$VERSION\"" jsr.json > tmp.json && mv tmp.json jsr.json | ||
git add jsr.json schema.json context.ts metaschema.ts | ||
git commit -m "Update schema JSR distribution" | ||
git push | ||
fi | ||
- name: Publish to JSR | ||
if: success() | ||
run: | | ||
npx jsr publish |
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
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.