roc/ci/build_basic_cli.sh
Anton-4 293148921d
basic-cli 0.20 (#8227)
* WIP basic-cli 0.20.0

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* disable typical CI

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* forgot tests dir

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* test on more OS

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* Remove ubuntu-20.04 from CI matrix

Official support for 20.04 was ended on 31 May 2025

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* test on ubuntu-24.04-arm too

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* macos ripgrep install

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* add ripgrep dep ubu

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* test musl hypothesis

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* Fix cargo copy

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* fix OS pattern linux arm64

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* Update build script to remove incompatible functions

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* Remove incompatible tests for Ubuntu builds

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* fix path

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* more musl removal

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* fix paths

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* fix multi command

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* debug with tree

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* install tree

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* test-cmd check

* correct filename

* no macos tests

* add macos again

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* debug cleanup

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* build tar.br release

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* back to normal CI

---------

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-09-01 16:14:33 +02:00

66 lines
1.7 KiB
Bash
Executable file

#!/usr/bin/env bash
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail
git clone https://github.com/roc-lang/basic-cli.git
cd basic-cli
git checkout $RELEASE_TAG
cd ..
if [ "$(uname -s)" == "Linux" ]; then
# check if musl-tools is installed
if ! dpkg -l | grep -q musl-tools; then
# install musl-tools with timeout for sudo problems with CI
timeout 300s sudo apt-get install -y musl-tools
fi
cd basic-cli/platform # we cd to install the target for the right rust version
# Remove these functions that don't work with musl.
sed -i.bak -e '/time_accessed!,$/d' -e '/time_modified!,$/d' -e '/time_created!,$/d' -e '/^time_accessed!/,/^$/d' -e '/^time_modified!/,/^$/d' -e '/^time_created!/,/^$/d' -e '/^import Utc exposing \[Utc\]$/d' File.roc
# Remove sed backup file
rm File.roc.bak
if [ "$(uname -m)" == "x86_64" ]; then
rustup target add x86_64-unknown-linux-musl
elif [ "$(uname -m)" == "aarch64" ]; then
rustup target add aarch64-unknown-linux-musl
fi
cd ../..
fi
mv $(ls -d artifact/* | grep "roc_nightly.*tar\.gz" | grep "$1") ./roc_nightly.tar.gz
# decompress the tar
tar -xzvf roc_nightly.tar.gz
# delete tar
rm roc_nightly.tar.gz
# simplify dir name
mv roc_nightly* roc_nightly
cd roc_nightly
export PATH="$(pwd -P):$PATH"
cd ..
# temp test
roc version
cd basic-cli
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ $(uname -m) == "aarch64" ]]; then
target_arch="aarch64-unknown-linux-musl"
else
target_arch="x86_64-unknown-linux-musl"
fi
fi
./jump-start.sh
# build the basic cli platform
roc build.roc --linker=legacy
cd ..