Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/commit_gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Commit Gate

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Or any other version you need

- name: Install dependencies
run: npm ci --prefix src/

- name: Build
run: npm run build --prefix src/

- name: Install test dependencies
run: npm ci --prefix tests/

- name: Run tests
run: npm run test --prefix tests/
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish npm package

on:
push:
tags: v*

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Get version from tag
id: get_version
# "refs/tags/v" is 11 characters
run: |
versionNumber=${GITHUB_REF:11}
echo "::set-output name=version_number::$versionNumber"

- name: checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Create npm package
run: |
cd src
npm version ${{ steps.get_version.outputs.version_number }}
npm ci
npm run build
npm pack

- name: Publish package
run: |
cd src
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
_*
**/node_modules
**/node_modules
**/built
19 changes: 18 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Debug Multifile",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/built/index.js",
"args": [
"-r",
"./samples/multiFile/invalid/duplicatePropertyname/sample/",
"-s",
"schemas/multiFile.relations.json",
"-o",
"_out/validationErrors.json"
],
"preLaunchTask": "npm: build - src",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
}
33 changes: 21 additions & 12 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "test",
"path": "tests",
"group": "test",
"problemMatcher": [],
"label": "npm: test - tests",
"detail": "jest"
}
]
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "test",
"path": "tests",
"group": "test",
"problemMatcher": [],
"label": "npm: test - tests",
"detail": "jest"
},
{
"type": "npm",
"script": "build",
"path": "src",
"group": "build",
"problemMatcher": [],
"label": "npm: build - src",
"detail": "tsc"
}
]
}
Loading