Skip to content

Commit

Permalink
Merge branch 'main' into escaped-dollar-sign-at-end-of-string-does-no…
Browse files Browse the repository at this point in the history
…t-parse
  • Loading branch information
yosefAlsuhaibani authored Aug 1, 2024
2 parents fe7fd8d + fe73604 commit 1402a65
Show file tree
Hide file tree
Showing 56 changed files with 563,911 additions and 512,077 deletions.
21 changes: 17 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
ci-cd:
- .github/**/*
- changed-files:
- any-glob-to-any-file:
- .github/**/*

grammar:
- grammar.js
- changed-files:
- any-glob-to-any-file:
- grammar.js

bindings:
- bindings/**/*
- changed-files:
- any-glob-to-any-file:
- bindings/**/*

examples:
- examples/**/*
- changed-files:
- any-glob-to-any-file:
- examples/**/*

scanner:
- changed-files:
- any-glob-to-any-file:
- src/scanner.c
18 changes: 8 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '12'
cache: 'npm'
node-version: '18'
- name: Install dependencies
run: npm install
- name: Generate parser
Expand All @@ -25,13 +25,11 @@ jobs:
diff=`git diff HEAD -- src`
echo "$diff"
test -z "$diff"
- name: Output parser size
run: du -sh src/* | sort -h
- name: Run tests
run: npm test
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- name: Build and test crate
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test
16 changes: 5 additions & 11 deletions .github/workflows/deploy-to-crates-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '12'
cache: 'npm'
node-version: '18'
- name: Install dependencies
run: npm install
- name: Compile grammar
run: npm run generate
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- name: Publish to crates.io
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATES_IO_TOKEN }}
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
68 changes: 49 additions & 19 deletions .github/workflows/deploy-to-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,63 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
env:
EMSCRIPTEN_VERSION: '3.1.55'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Clone gh-pages branch into nested directory
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Configure Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Get tag name
id: tag
run: |
tag=$(basename "${{ github.ref }}")
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '12'
cache: 'npm'
node-version: '18'
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- name: Install dependencies
run: npm install
- name: Compile grammar
run: npm run generate
- name: Build WASM binary
- name: Build Wasm binary
run: npm run build-wasm
- name: Deploy to GitHub Releases
uses: ncipollo/release-action@v1
with:
artifacts: tree-sitter-kotlin.wasm
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up folder for GitHub Pages deployment
run: |
mkdir public
cp tree-sitter-kotlin.wasm public/tree-sitter-parser.wasm
tag="${{ steps.tag.outputs.tag }}"
gh release create "$tag" --title "$tag"
gh release upload "$tag" tree-sitter-kotlin.wasm
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
keep_files: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
run: |
sha="$(git rev-parse --short HEAD)"
tag="${{ steps.tag.outputs.tag }}"
echo "==> Replacing Wasm binary..."
rm -rf gh-pages/assets/tree-sitter-kotlin*
mkdir -p "gh-pages/assets/tree-sitter-kotlin-$tag"
cp tree-sitter-kotlin.wasm "gh-pages/assets/tree-sitter-kotlin-$tag"
tree gh-pages/assets
echo "==> Updating version on website..."
sed -i "s|\(LANGUAGE_BASE_URL = \"\)[^\"]*\(\"\)|\1assets/tree-sitter-kotlin-$tag\2|g" gh-pages/index.html
sed -i "s|\(<span class=\"version\">\)[^<]*\(</span>\)|\1$tag\2|g" gh-pages/index.html
echo "==> Committing and pushing gh-pages branch..."
cd gh-pages
git add .
git commit -m "Deploy tree-sitter-kotlin $tag ($sha)"
git push
7 changes: 3 additions & 4 deletions .github/workflows/deploy-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '18'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Compile grammar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
27 changes: 27 additions & 0 deletions .github/workflows/regenerate-parser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Regenerate Parser

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Generate parser
run: npm run generate
- name: Commit the updated parser
run: |
git add src
git commit -m "Regenerate the parser ($(git rev-parse --short HEAD))"
git push
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,21 @@ node_modules
*.lib
*.obj

# WASM
# Wasm
*.asm.js
*.wasm
*.wasm.mem

# Rust build artifacts
target

# C
/*.a
/*.dylib
/*.so*
*.o
/bindings/c/*.h
/bindings/c/tree-sitter-*.pc

# Swift
.build
38 changes: 25 additions & 13 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-kotlin"
description = "Kotlin grammar for the tree-sitter parsing library"
version = "0.2.11"
version = "0.3.8"
keywords = ["incremental", "parsing", "kotlin"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/fwcd/tree-sitter-kotlin"
Expand All @@ -21,7 +21,7 @@ include = [
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "0.20"
tree-sitter = ">= 0.21, < 0.23"

[build-dependencies]
cc = "1.0"
Loading

0 comments on commit 1402a65

Please sign in to comment.