Skip to content

Commit

Permalink
Merge pull request #5 from stackmystack/regen-parsers-before-compilation
Browse files Browse the repository at this point in the history
Regen parsers before compilation
  • Loading branch information
stackmystack authored Dec 7, 2023
2 parents 36d0583 + 101b869 commit 4048071
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
lang:
- bash
- c
- cpp
# - cpp # FIXME: `lang` needs to handle things differently maybe because it won't generate for this
- embedded-template
- html
- java
Expand All @@ -20,8 +20,8 @@ jobs:
- ruby
- rust
target:
- { platform: linux-arm, triplet: arm-linux-gnueabi }
- { platform: linux-arm64, triplet: aarch64-linux-gnu }
# - { platform: linux-arm, triplet: arm-linux-gnueabi }
# - { platform: linux-arm64, triplet: aarch64-linux-gnu }
- { platform: linux-x64, triplet: x86_64-linux-gnu }
# NOTE:
# Now that we depend in tree-sitter-cli to regenerate the pulled parser
Expand All @@ -46,8 +46,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build ${{ matrix.lang }} for ${{ matrix.target.platform }}
env:
PLATFORM: ${{ matrix.target.platform }}
run: |
docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=${{ matrix.target.triplet }} -e PLATFORM=${{ matrix.target.platform }} multiarch/crossbuild ./lang d ${{ matrix.lang }}
./lang d ${{ matrix.lang }}
# docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=${{ matrix.target.triplet }} -e PLATFORM=${{ matrix.target.platform }} multiarch/crossbuild ./lang d ${{ matrix.lang }}
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
13 changes: 10 additions & 3 deletions lang
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ fi

if [ -n "$PLATFORM" ]
then
arch=$(uname -m)
wget "https://github.com/tree-sitter/tree-sitter/releases/download/v$tstag/tree-sitter-$PLATFORM.gz"
cli="tree-sitter-$PLATFORM"
gz="$cli.gz"
wget "https://github.com/tree-sitter/tree-sitter/releases/download/v$tstag/$gz"
gunzip "$gz"
chmod +x "$cli"
fi

# ################################################ #
Expand Down Expand Up @@ -99,7 +102,11 @@ do
cd ..
fi

cd $GET/src
# Regenerate. See https://github.com/tree-sitter/tree-sitter/issues/2731
cd $GET
../$cli generate
# clean
cd src
set +e
rm *.o
rm *.$extout*
Expand Down

0 comments on commit 4048071

Please sign in to comment.