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
19 changes: 19 additions & 0 deletions .github/workflows/package-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ on:
description: The tree-sitter ABI version
default: 15
type: number
swap-size:
description: >
Resize the runner swap space before the Wasm build.
Set to a size such as "64G" to allocate that much swap, or leave
as "normal" (the default) to skip the resize entirely.
Useful for grammars whose Wasm compilation exceeds available memory.
default: normal
type: string
secrets:
NODE_AUTH_TOKEN:
description: An authentication token for npm
Expand Down Expand Up @@ -57,6 +65,17 @@ jobs:
done < <(jq -r '.grammars[].path // "."' tree-sitter.json)
env:
TREE_SITTER_ABI_VERSION: ${{inputs.abi-version}}
- name: Increase swap space
if: inputs.swap-size != 'normal'
run: |
sudo swapoff -a
sudo fallocate -l "$SWAP_SIZE" /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
env:
SWAP_SIZE: ${{inputs.swap-size}}
- name: Build Wasm binaries
run: |-
while read -r grammar_dir; do
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ on:
description: The tree-sitter ABI version
default: 15
type: number
swap-size:
description: >
Resize the runner swap space before the Wasm build.
Set to a size such as "64G" to allocate that much swap, or leave
as "normal" (the default) to skip the resize entirely.
Useful for grammars whose Wasm compilation exceeds available memory.
default: normal
type: string

permissions:
contents: write
Expand Down Expand Up @@ -54,6 +62,17 @@ jobs:
done < <(jq -r '.grammars[].path // "."' tree-sitter.json)
env:
TREE_SITTER_ABI_VERSION: ${{inputs.abi-version}}
- name: Increase swap space
if: inputs.swap-size != 'normal'
run: |
sudo swapoff -a
sudo fallocate -l "$SWAP_SIZE" /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
env:
SWAP_SIZE: ${{inputs.swap-size}}
- name: Build Wasm binaries
shell: bash
run: |-
Expand Down