diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e09eac43..7c756558 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,10 +22,15 @@ jobs: asset_name: vim-doge-helper-macos-aarch64 asset_path: ./bin/vim-doge-helper-macos-aarch64.tar.gz - - platform: ubuntu-20.04 # Linux + - platform: ubuntu-20.04 # Intel-based target: x86_64-unknown-linux-gnu - asset_name: vim-doge-helper-linux - asset_path: ./bin/vim-doge-helper-linux.tar.gz + asset_name: vim-doge-helper-linux-x86_64 + asset_path: ./bin/vim-doge-helper-linux-x86_64.tar.gz + + - platform: ubuntu-20.04 # Apple Silicon + target: aarch64-unknown-linux-gnu + asset_name: vim-doge-helper-linux-aarch64 + asset_path: ./bin/vim-doge-helper-linux-aarch64.tar.gz - platform: windows-latest target: x86_64-pc-windows-msvc # 64-bit @@ -45,7 +50,12 @@ jobs: - name: Install Rust stable uses: dtolnay/rust-toolchain@stable with: - targets: aarch64-apple-darwin + targets: aarch64-apple-darwin, aarch64-unknown-linux-gnu + + - name: Install Cargo dependencies (linux) + if: runner.os == 'Linux' + run: cargo install cross + shell: bash - name: Build (unix) if: runner.os != 'Windows' diff --git a/.version b/.version index fcdb2e10..ee74734a 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -4.0.0 +4.1.0 diff --git a/helper/Cargo.toml b/helper/Cargo.toml index 2f7c2626..bbf95743 100644 --- a/helper/Cargo.toml +++ b/helper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vim-doge-helper" -version = "4.0.0" +version = "4.1.0" edition = "2021" publish = false include = ["src"] @@ -15,7 +15,7 @@ serde = { version = "1.0.104", features = ["derive"] } serde_json = "1.0.99" serde_yaml = "0.9.22" tree-sitter = "0.20.10" -tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "4936467" } +tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "1b0321e" } tree-sitter-lua = { git = "https://github.com/Azganoth/tree-sitter-lua", rev = "e198b76" } tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby", rev = "f257f3f" } tree-sitter-rust = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "0a70e15" } @@ -25,8 +25,4 @@ tree-sitter-python = { git = "https://github.com/tree-sitter/tree-sitter-python" tree-sitter-c = { git = "https://github.com/tree-sitter/tree-sitter-c", rev = "84bdf40" } tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "0e7b7a0" } tree-sitter-typescript = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3429d8c" } - -# Waiting for these to be merged: -# - https://github.com/tree-sitter/tree-sitter-php/pull/181 -# - https://github.com/tree-sitter/tree-sitter-bash/pull/182 -tree-sitter-php = { git = "https://github.com/amaanq/tree-sitter-php", branch = "fix-conflicts" } +tree-sitter-php = { git = "https://github.com/tree-sitter/tree-sitter-php", rev = "d43130f" } diff --git a/scripts/build.sh b/scripts/build.sh index ae8e3f23..973b5cb7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -8,6 +8,12 @@ set -u ROOT_DIR=$(cd "$(dirname "$0")/.."; pwd -P) BUILD_TARGET="${1:-}" OUTFILE="${2:-}" +OS="$(uname)" + +CMD="cargo" +if [[ "$OS" != "Darwin" ]] && command -v cross >/dev/null 2>&1; then + CMD="cross" +fi cd $ROOT_DIR [[ ! -d ./bin ]] && mkdir ./bin @@ -16,10 +22,10 @@ cd $ROOT_DIR # Build the binary. cd $ROOT_DIR/helper if [[ "$BUILD_TARGET" != "" ]]; then - cargo build --release --target "$BUILD_TARGET" + eval "$CMD build --release --target $BUILD_TARGET" cp target/$BUILD_TARGET/release/vim-doge-helper ../bin/ else - cargo build --release + eval "$CMD build --release" cp target/release/vim-doge-helper ../bin/ fi diff --git a/scripts/install.sh b/scripts/install.sh index 2be21c8c..92cd7714 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -34,7 +34,11 @@ if [ $OS = 'Darwin' ]; then TARGET="vim-doge-helper-macos-x86_64" fi elif [ $OS = 'Linux' ]; then - TARGET="vim-doge-helper-linux" + if [ $ARCH = 'aarch64' ]; then + TARGET="vim-doge-helper-linux-aarch64" + else + TARGET="vim-doge-helper-linux-x86_64" + fi else echo "vim-doge does not support your system" exit 1