From 695804c544a0c9bb8afc435d59672ec078d64208 Mon Sep 17 00:00:00 2001 From: Andreas <38031952+AnHeuermann@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:45:30 +0100 Subject: [PATCH] Updating to Node 20 (#14) * Adding Node 20 engine * Automated release --- .gitattributes | 1 + .github/workflows/build-parser.yml | 25 +++++++++++++++++++- README.md | 2 +- package-lock.json | 38 +++++++++++------------------- package.json | 7 ++++-- 5 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..053cc78 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +src/** -diff linguist-generated=true diff --git a/.github/workflows/build-parser.yml b/.github/workflows/build-parser.yml index f45df9b..9cfc6aa 100644 --- a/.github/workflows/build-parser.yml +++ b/.github/workflows/build-parser.yml @@ -8,6 +8,8 @@ on: push: branches: - master + tags: + - "v*.*.*" jobs: build: @@ -16,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - name: Clean install run: npm ci - name: Run build script @@ -30,3 +32,24 @@ jobs: name: tree-sitter-modelica.wasm path: | tree-sitter-modelica.wasm + if-no-files-found: error + + release: + if: startsWith(github.ref, 'refs/tags/') + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + name: tree-sitter-modelica.wasm + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + tree-sitter-modelica.wasm + fail_on_unmatched_files: true + generate_release_notes: true + append_body: true diff --git a/README.md b/README.md index ab80860..6a9eb2a 100644 --- a/README.md +++ b/README.md @@ -95,4 +95,4 @@ successfully parsed and highlighted. ```bash npx tree-sitter parse examples/DrumBoiler.mo npx tree-sitter highlight examples/DrumBoiler.mo -``` \ No newline at end of file +``` diff --git a/package-lock.json b/package-lock.json index 8d6334b..cb89314 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,46 +1,36 @@ { "name": "tree-sitter-modelica", - "version": "0.0.0", - "lockfileVersion": 2, + "version": "0.1.0", + "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tree-sitter-modelica", - "version": "0.0.0", + "version": "0.1.0", "dependencies": { - "nan": "^2.15.0" + "nan": "^2.18.0" }, "devDependencies": { - "tree-sitter-cli": "0.20.4" + "tree-sitter-cli": "0.20.8" + }, + "engines": { + "node": "20" } }, "node_modules/nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==" }, "node_modules/tree-sitter-cli": { - "version": "0.20.4", - "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.20.4.tgz", - "integrity": "sha512-G42x0Ev7mxA8WLUfZY+two5LIhPf6R/m7qDZtKxOzE77zXi6didNI/vf17kHaKaRXJrWnyCxHFaVQFO2LL81yg==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.20.8.tgz", + "integrity": "sha512-XjTcS3wdTy/2cc/ptMLc/WRyOLECRYcMTrSWyhZnj1oGSOWbHLTklgsgRICU3cPfb0vy+oZCC33M43u6R1HSCA==", "dev": true, "hasInstallScript": true, "bin": { "tree-sitter": "cli.js" } } - }, - "dependencies": { - "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" - }, - "tree-sitter-cli": { - "version": "0.20.4", - "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.20.4.tgz", - "integrity": "sha512-G42x0Ev7mxA8WLUfZY+two5LIhPf6R/m7qDZtKxOzE77zXi6didNI/vf17kHaKaRXJrWnyCxHFaVQFO2LL81yg==", - "dev": true - } } } diff --git a/package.json b/package.json index eabee8f..1119ebf 100644 --- a/package.json +++ b/package.json @@ -3,15 +3,18 @@ "version": "0.1.0", "description": "Modelica grammar for tree-sitter", "main": "bindings/node", + "engines": { + "node": "20" + }, "scripts": { "build": "npx tree-sitter generate && npx node-gyp configure && npx node-gyp build && npx tree-sitter build-wasm . --docker", "test": "tree-sitter test" }, "dependencies": { - "nan": "^2.15.0" + "nan": "^2.18.0" }, "devDependencies": { - "tree-sitter-cli": "0.20.4" + "tree-sitter-cli": "0.20.8" }, "tree-sitter": [ {