Build linux-x86_64 dependencies #212
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build linux-x86_64 dependencies | |
on: | |
schedule: | |
# Runs 30 min past every 12 h | |
- cron: "30 */12 * * *" | |
workflow_dispatch: | |
# Prevent concurrent auto-commits | |
concurrency: | |
group: auto-commit-linux-x86_64 | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Install C/C++ Compiler | |
uses: rlalik/setup-cpp-compiler@master | |
with: | |
compiler: gcc | |
- name: Install Rust Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- uses: tree-sitter/setup-action@v1 | |
with: | |
tree-sitter-ref: v0.22.6 | |
- name: Install Lua | |
uses: leso-kn/gh-actions-lua@master | |
with: | |
luaVersion: "5.1" | |
- name: Install Luarocks | |
uses: hishamhm/gh-actions-luarocks@master | |
- uses: rhysd/action-setup-vim@v1 | |
with: | |
neovim: true | |
version: stable | |
- name: Get tree-sitter ABI version | |
run: | | |
# NOTE: Neovim prints output to stderr | |
ABI_VERSION="$(nvim -u NORC -c 'lua print(vim.treesitter.language_version)' --headless +q 2>&1)" | |
echo "TREE_SITTER_LANGUAGE_VERSION=$ABI_VERSION" >> $GITHUB_ENV | |
- name: Print environment | |
run: | | |
printenv | |
- name: Install `LuaFileSystem` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install luafilesystem | |
luarocks pack luafilesystem | |
- name: Install `luarocks-build-rust-mlua` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install luarocks-build-rust-mlua | |
luarocks pack luarocks-build-rust-mlua | |
- name: Install TOML Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install toml | |
luarocks --verbose pack toml | |
- name: Install `toml-edit` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install toml-edit | |
luarocks pack toml-edit | |
- name: Install `fzy` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install fzy | |
luarocks pack fzy | |
- name: Install `jsregexp` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install jsregexp | |
luarocks pack jsregexp | |
- name: Install `curl` headers | |
if: always() | |
run: sudo apt-get install -y libcurl4-gnutls-dev | |
- name: Install `lua-curl` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install lua-curl CURL_INCDIR=/usr/include/x86_64-linux-gnu | |
luarocks pack lua-curl | |
- name: Install `tree-sitter-orgmode` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install tree-sitter-orgmode | |
luarocks pack tree-sitter-orgmode | |
- name: Install `tree-sitter-norg` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install tree-sitter-norg | |
luarocks pack tree-sitter-norg | |
- name: Install `tree-sitter-norg-meta` Package | |
if: always() | |
run: | | |
luarocks --local --lua-version=5.1 install tree-sitter-norg-meta | |
luarocks pack tree-sitter-norg-meta | |
- name: Get tree-sitter-parsers.json | |
if: always() | |
uses: actions/checkout@v4 | |
with: | |
repository: nvim-neorocks/nurr | |
sparse-checkout: | | |
tree-sitter-parsers.json | |
path: nurr | |
- name: Install tree-sitter parsers | |
if: always() | |
run: | | |
# Filter out parsers that need their sources generated | |
# We might want to consider adding those too | |
langs=$(jq -r '.parsers[] | select((.install_info.requires_generate_from_grammar // false) == false) | .lang' nurr/tree-sitter-parsers.json) | |
for lang in $langs; do | |
luarocks --local --lua-version=5.1 install "tree-sitter-$lang" \ | |
&& luarocks pack "tree-sitter-$lang" \ | |
|| echo "tree-sitter-$lang has not been packaged yet" | |
done | |
- name: Regenerate Manifests and HTML | |
if: always() | |
run: luarocks-admin make-manifest --lua-version=5.1 . | |
- name: commit-linux-x86_64 | |
if: always() | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: update linux-x86_64 build artifacts" | |
file_pattern: "*.linux-x86_64.rock *.all.rock manifest* index.html" |