From f158e585f2ec828f59c3bf10b78699655cd2715f Mon Sep 17 00:00:00 2001 From: Esko Luontola Date: Fri, 4 Oct 2024 15:49:32 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20WIP:=20Use=20asdf=20on=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: - Use the same mechanism for managing versions on CI as locally. --- .semaphore/semaphore.yml | 10 ++++++++++ scripts/install-asdf.sh | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 scripts/install-asdf.sh diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 7e59fbe4..8af67b13 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -26,6 +26,16 @@ blocks: - sem-version java 17 - nvm install 21 - sudo apt-get install -y zopfli brotli + - which java + - java --version + - which node + - node --version + - ./scripts/install-asdf.sh + - which java + - java --version + - which node + - node --version + - asdf current - ./scripts/build.sh diff --git a/scripts/install-asdf.sh b/scripts/install-asdf.sh new file mode 100755 index 00000000..1c7cd171 --- /dev/null +++ b/scripts/install-asdf.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euxo pipefail + +if [ -d ~/.asdf ]; then + exit 0 +fi + +git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1 +#echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc +. "$HOME/.asdf/asdf.sh" +asdf plugin add java +asdf plugin add nodejs +asdf install