Build macosx-aarch64 dependencies #389
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 macosx-aarch64 dependencies | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["Build linux-x86_64 dependencies"] | |
branches: [main] | |
types: | |
- completed | |
# Prevent concurrent auto-commits | |
concurrency: | |
group: auto-commit-macosx-aarch64 | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@main | |
- name: Install C/C++ Compiler | |
run: nix profile install nixpkgs#clang | |
- name: Install Rust Toolchain (macos) | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
rustflags: "-C link-arg=-undefined -C link-arg=dynamic_lookup" | |
- uses: tree-sitter/setup-action@v1 | |
- name: Install Lua | |
uses: leso-kn/gh-actions-lua@master | |
with: | |
luaVersion: "5.1" | |
- name: Install Luarocks | |
uses: hishamhm/gh-actions-luarocks@master | |
- name: Configure architecture | |
run: | | |
mkdir -p /Users/runner/.luarocks | |
luarocks --verbose --local config arch macosx-aarch64 | |
- 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: ./scripts/pack_binary_rock.lua luafilesystem macosx-aarch64 | |
- 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: ./scripts/pack_binary_rock.lua toml macosx-aarch64 | |
- name: Install `toml-edit` Package | |
if: always() | |
run: ./scripts/pack_binary_rock.lua toml-edit macosx-aarch64 | |
- name: Install `fzy` Package | |
if: always() | |
run: ./scripts/pack_binary_rock.lua fzy macosx-aarch64 | |
- name: Install `jsregexp` Package | |
if: always() | |
run: ./scripts/pack_binary_rock.lua jsregexp macosx-aarch64 | |
- name: Install `tree-sitter-orgmode` Package | |
if: always() | |
run: ./scripts/pack_binary_rock.lua tree-sitter-orgmode macosx-aarch64 | |
- name: Install `tree-sitter-norg` Package | |
if: always() | |
run: ./scripts/pack_binary_rock.lua tree-sitter-norg macosx-aarch64 | |
env: | |
CXX: "clang++" | |
- name: Install `tree-sitter-norg-meta` Package | |
if: always() | |
run: ./scripts/pack_binary_rock.lua tree-sitter-norg-meta macosx-aarch64 | |
- 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 | |
./scripts/pack_binary_rock.lua "tree-sitter-$lang" "macosx-aarch64" \ | |
|| echo "Skipping tree-sitter-$lang" | |
done | |
- name: Regenerate Manifests and HTML | |
if: always() | |
run: luarocks-admin make-manifest --lua-version=5.1 . | |
- name: commit-macosx-aarch64 | |
if: always() | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: update macosx-aarch64 build artifacts" | |
file_pattern: "*.macosx-aarch64.rock *.all.rock manifest* index.html" |