Skip to content

Commit

Permalink
Merge pull request #28 from tonyfettes/gitattributes-and-ci
Browse files Browse the repository at this point in the history
auto bump parser.c etc
  • Loading branch information
tonyfettes authored Mar 12, 2024
2 parents 49408c8 + 08d1977 commit fc7f9af
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bindings/** -diff
binding.gyp -diff
Cargo.toml -diff
Cargo.lock -diff
src/parser.c -diff
src/tree_sitter/parser.h -diff
src/node-types.json -diff
src/grammar.json -diff
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build

on:
push:
branches: [ "main" ]

jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: build
run: pnpm run generate

- name: Commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -a -m "build: bump artifacts [skip ci]"
git push origin HEAD:main
71 changes: 71 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/tree-sitter/tree-sitter-moonbit"
edition = "2018"
license = "MIT"

build = "bindings/rust/build.rs"

include = [
"bindings/rust/*",
"grammar.js",
Expand Down
2 changes: 0 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
"target_name": "tree_sitter_moonbit_binding",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"src"
],
"sources": [
"bindings/node/binding.cc",
"src/parser.c",
"src/scanner.c",
# If your language uses an external scanner, add it here.
],
"cflags_c": [
Expand Down

0 comments on commit fc7f9af

Please sign in to comment.