Skip to content

Build macosx-aarch64 dependencies #163

Build macosx-aarch64 dependencies

Build macosx-aarch64 dependencies #163

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 gcc
run: |
nix profile install nixpkgs#gcc
- 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
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: "[HACK: luarocks/#1630] backup x86_64 packages"
run: for f in *.macosx-x86_64.rock; do mv "$f" "$f.bak"; done
- name: Install `LuaFileSystem` Package
run: |
luarocks --verbose --local --lua-version=5.1 install luafilesystem
luarocks --verbose pack luafilesystem
- name: Install `luarocks-build-rust-mlua` Package
run: |
luarocks --verbose --local --lua-version=5.1 install luarocks-build-rust-mlua
luarocks --verbose pack luarocks-build-rust-mlua
- name: Install TOML Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml
luarocks --verbose pack toml
- name: Install `toml-edit` Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml-edit
luarocks --verbose pack toml-edit
- name: Install `fzy` Package
run: |
luarocks --verbose --local --lua-version=5.1 install fzy
luarocks --verbose pack fzy
- name: Install `jsregexp` Package
run: |
luarocks --verbose --local --lua-version=5.1 install jsregexp
luarocks --verbose pack jsregexp
- name: Install `tree-sitter-orgmode` Package
run: |
luarocks --verbose --local --lua-version=5.1 install tree-sitter-orgmode
luarocks --verbose pack tree-sitter-orgmode
- name: Install `tree-sitter-norg` Package
run: |
luarocks --verbose --local --lua-version=5.1 install tree-sitter-norg
luarocks --verbose pack tree-sitter-norg
- name: Install `tree-sitter-norg-meta` Package
run: |
luarocks --verbose --local --lua-version=5.1 install tree-sitter-norg-meta
luarocks --verbose pack tree-sitter-norg-meta
# - name: Install `luarocks-build-treesitter-parser` Package
# run: |
# luarocks --verbose --local --lua-version=5.1 install luarocks-build-treesitter-parser
# - name: Get tree-sitter-parsers.json
# uses: actions/checkout@v4
# with:
# repository: nvim-neorocks/nurr
# sparse-checkout: |
# tree-sitter-parsers.json
# path: nurr
# - name: Install tree-sitter parsers
# 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
# rm "tree-sitter-$lang-scm-1.macosx-aarch64.rock" || true
# luarocks --local --lua-version=5.1 install "tree-sitter-$lang" \
# && luarocks pack "tree-sitter-$lang" || echo "Failed to pack tree-sitter-$lang"
# done
- name: "[HACK: luarocks/#1630] work around"
run: for f in *.macosx-x86_64.rock; do mv "$f" "$(echo "$f" | sed s/x86_64/aarch64/)"; done
- name: "[HACK: luarocks/#1630] restore x86_64 backups"
run: for f in *.macosx-x86_64.rock.bak; do mv "$f" "$(echo "$f" | sed s/\.bak$//)"; done
- name: Regenerate Manifests and HTML
run: luarocks-admin make-manifest --lua-version=5.1 .
- name: commit-macosx-aarch64
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update macosx-aarch64 build artifacts"
file_pattern: "*.rock manifest* index.html"