Skip to content

doc: Adopt scriv as a changelog manager #130

doc: Adopt scriv as a changelog manager

doc: Adopt scriv as a changelog manager #130

Workflow file for this run

---
name: Deno build
on:
push:
branches: [master, main]
tags: ['*']
pull_request:
branches: [master, main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
debug_info:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git status
- run: git describe
- run: env
- name: Dump github context
run: echo $GITHUB_CONTEXT | jq .
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Save describe stamp
id: describe
run: echo version=$( git describe ) >> $GITHUB_OUTPUT
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: deno --node-modules-dir=auto -A ./build.ts
- run: deno run -A ./dist/validator/bids-validator.js --version
- uses: actions/upload-artifact@v4
with:
name: main
path: dist/validator
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
allow-net: [true, false]
fail-fast: false
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Set permissions with network access
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --allow-net' >> $GITHUB_ENV
if: ${{ matrix.allow-net }}
- name: Set permissions without network access
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --deny-net' >> $GITHUB_ENV
if: ${{ ! matrix.allow-net }}
- name: Disable example that requires network access
run: touch tests/data/bids-examples/xeeg_hed_score/.SKIP_VALIDATION
if: ${{ ! matrix.allow-net }}
- name: Disable unreleased examples
run: touch tests/data/bids-examples/dwi_deriv/.SKIP_VALIDATION
if: github.ref_name != 'dev' && github.base_ref != 'dev'
- run: deno test --node-modules-dir=auto $PERMS --coverage=cov/ src/
- name: Collect coverage
run: deno coverage cov/ --lcov --output=coverage.lcov
if: ${{ always() }}
- uses: codecov/codecov-action@v4
if: ${{ always() }}
with:
files: coverage.lcov
publish-dry-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: deno publish --dry-run
publish:
runs-on: ubuntu-latest
needs: [test, publish-dry-run]
if: github.ref_type == 'tag'
permissions:
contents: read
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
- name: Check tag matches ${{ github.ref_name }}
run: jq -e ".version[:1] != \"v\" and .version==\"$TAG\"" deno.json
env:
TAG: ${{ github.ref_name }}
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: deno publish
deploy:
needs: [build]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' && github.repository_owner == 'bids-standard'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TOKEN }}
- name: Set credentials
run: |
git config --global user.name "BIDS-Bot"
git config --global user.email "bids-maintenance@users.noreply.github.com"
- name: Reset deno-build to orphan
run: |
git checkout --orphan deno-build
git reset --hard
- uses: actions/download-artifact@v4
with:
name: main
path: main
- name: Commit to new branch
run: |
mv main/main.js main/bids-validator.js .
git add main.js bids-validator.js
git commit -m "BLD: $VERSION [skip ci]" || true
env:
VERSION: ${{ needs.build.describe.version }}
- name: Push
run: git push -f origin deno-build