From 6444286cbf3a37862feaa7ff86456dd948f5cf8b Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sat, 10 Feb 2024 15:33:57 +0100 Subject: ci: fix invalid workflow Context variables aren't always available, so we can't rely on them for e.g. environment variables. Also merge all install scripts into `script/ci-install.sh`, that way it can be called the same way regardless of system. --- scripts/ci-install-macos-14.sh | 7 ------- scripts/ci-install-ubuntu-latest.sh | 8 -------- scripts/ci-install-windows-2022.sh | 7 ------- scripts/ci-install.sh | 25 +++++++++++++++++++++++++ 4 files changed, 25 insertions(+), 22 deletions(-) delete mode 100755 scripts/ci-install-macos-14.sh delete mode 100755 scripts/ci-install-ubuntu-latest.sh delete mode 100755 scripts/ci-install-windows-2022.sh create mode 100755 scripts/ci-install.sh (limited to 'scripts') diff --git a/scripts/ci-install-macos-14.sh b/scripts/ci-install-macos-14.sh deleted file mode 100755 index 06bce74f7..000000000 --- a/scripts/ci-install-macos-14.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -curl -L https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-macos.tar.gz | tar -xz -sudo ln -s "$PWD"/nvim-macos/bin/nvim /usr/local/bin -rm -rf "$PWD"/nvim-macos/lib/nvim/parser -mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start -ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start diff --git a/scripts/ci-install-ubuntu-latest.sh b/scripts/ci-install-ubuntu-latest.sh deleted file mode 100755 index 60f260cc8..000000000 --- a/scripts/ci-install-ubuntu-latest.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-linux64.tar.gz -tar -zxf nvim-linux64.tar.gz -sudo ln -s "$PWD"/nvim-linux64/bin/nvim /usr/local/bin -rm -rf "$PWD"/nvim-linux64/lib/nvim/parser -mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start -ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start diff --git a/scripts/ci-install-windows-2022.sh b/scripts/ci-install-windows-2022.sh deleted file mode 100755 index 8d27ecc53..000000000 --- a/scripts/ci-install-windows-2022.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -curl -L https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-win64.zip -o nvim-win64.zip -unzip nvim-win64 -mkdir -p ~/AppData/Local/nvim/pack/nvim-treesitter/start -mkdir -p ~/AppData/Local/nvim-data -cp -r "$PWD" ~/AppData/Local/nvim/pack/nvim-treesitter/start diff --git a/scripts/ci-install.sh b/scripts/ci-install.sh new file mode 100755 index 000000000..4f4265465 --- /dev/null +++ b/scripts/ci-install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +os=$(uname -s) +if [[ $os == Linux ]]; then + wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-linux64.tar.gz + tar -zxf nvim-linux64.tar.gz + sudo ln -s "$PWD"/nvim-linux64/bin/nvim /usr/local/bin + rm -rf "$PWD"/nvim-linux64/lib/nvim/parser + mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start + ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start +elif [[ $os == Darwin ]]; then + curl -L https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-macos.tar.gz | tar -xz + sudo ln -s "$PWD"/nvim-macos/bin/nvim /usr/local/bin + rm -rf "$PWD"/nvim-macos/lib/nvim/parser + mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start + ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start +else + curl -L https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-win64.zip -o nvim-win64.zip + unzip nvim-win64 + mkdir -p ~/AppData/Local/nvim/pack/nvim-treesitter/start + mkdir -p ~/AppData/Local/nvim-data + cp -r "$PWD" ~/AppData/Local/nvim/pack/nvim-treesitter/start +fi -- cgit v1.2.3-70-g09d2