From 98865d0294054867dc601fe0b020695c4bccbfa3 Mon Sep 17 00:00:00 2001 From: Andreas Salhus Bakseter <141913422+baksetercx@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:22:34 +0200 Subject: [PATCH 1/2] Add oneline install --- README.md | 10 +++++++++ docs/installation.md | 8 +++++++ install.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100755 install.sh diff --git a/README.md b/README.md index 93b5e18..654c3a4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ **3lv** – the Command Line Interface tool for creating, building and securing Elvia applications ⚡ +## 📦 Installation + +### TL;DR + +```bash +curl -fsSL https://raw.githubusercontent.com/3lvia/cli/trunk/install.sh | bash +``` + +### See [Installation](docs/installation.md) for more options. + ## 🚀 Features - **Build** a container for .NET, Go or Python projects without needing a Dockerfile. diff --git a/docs/installation.md b/docs/installation.md index ba582eb..928e271 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,5 +1,11 @@ ## 💾 Installation +### TL;DR + +```bash +curl -fsSL https://raw.githubusercontent.com/3lvia/cli/trunk/install.sh | bash +``` + Supported platforms: - **Linux/WSL** (recommended) @@ -29,7 +35,9 @@ sudo install -Dm755 -t /usr/local/bin 3lv ``` #### Example Mac installation + The installation is done by first installing the app, secondly trying (and failing) to open it, and thirdly [allowing the opening of it](https://support.apple.com/en-gb/guide/mac-help/mh40616/mac). + ```bash tar -xzf 3lv-macos-arm64.tar.gz sudo install -Dm755 3lv /usr/local/bin/ diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..cd258a9 --- /dev/null +++ b/install.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +set -euo pipefail + +LATEST_VERSION=$(curl -fsSl https://raw.githubusercontent.com/3lvia/cli/refs/heads/trunk/VERSION) + +# Check if mac or linux +if [[ "$OSTYPE" == "darwin"* ]]; then + OS="mac" +elif [[ "$OSTYPE" == "linux-gnu"* ]]; then + OS="linux" +else + echo "Unsupported OS: $OSTYPE" + exit 1 +fi + +# Check architecture +ARCH=$(uname -m) +if [[ "$ARCH" == "x86_64" ]]; then + ARCH="amd64" +elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then + ARCH="arm64" +else + echo "Unsupported architecture: $ARCH" + exit 1 +fi + +cd "$(mktemp -d)" +TARBALL="3lv-$LATEST_VERSION-$OS-$ARCH.tar.gz" + +curl -fsSL -o "$TARBALL" "https://github.com/3lvia/cli/releases/download/v$LATEST_VERSION/$TARBALL" +curl -fsSL -o "$TARBALL.md5" "https://github.com/3lvia/cli/releases/download/v$LATEST_VERSION/$TARBALL.md5" + +# Check if md5sum is installed +if ! md5sum --version &> /dev/null; then + echo "Command 'md5sum' could not be found, will skip verifying integrity of the download." + echo "In the future, please ensure md5sum is installed." +else + md5sum -c "$TARBALL.md5" +fi + +tar -xzf "$TARBALL" + +if [[ "$OS" == "mac" ]]; then + sudo install -Dm755 3lv /usr/local/bin/ +else + sudo install -Dm755 -t /usr/local/bin 3lv +fi + +echo "3lv version $LATEST_VERSION installed successfully!" From df16a2f5e907bf47938ca2dd9491fa1184e38978 Mon Sep 17 00:00:00 2001 From: Andreas Salhus Bakseter <141913422+baksetercx@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:25:16 +0200 Subject: [PATCH 2/2] Add workflow for testing install script --- .github/workflows/analyze-test-lint.yaml | 2 ++ .github/workflows/build-release.yaml | 2 ++ .github/workflows/e2e-tests.yaml | 1 + .github/workflows/test-install-script.yaml | 19 +++++++++++++++++++ 4 files changed, 24 insertions(+) create mode 100644 .github/workflows/test-install-script.yaml diff --git a/.github/workflows/analyze-test-lint.yaml b/.github/workflows/analyze-test-lint.yaml index dfe7a4d..035a78f 100644 --- a/.github/workflows/analyze-test-lint.yaml +++ b/.github/workflows/analyze-test-lint.yaml @@ -6,11 +6,13 @@ on: paths-ignore: - 'docs/**' - 'README.md' + - 'install.sh' pull_request: branches: [trunk] paths-ignore: - 'docs/**' - 'README.md' + - 'install.sh' concurrency: group: '${{ github.workflow }}-${{ github.ref }}' diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index b0f3f36..8d109e9 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -6,11 +6,13 @@ on: paths-ignore: - 'docs/**' - 'README.md' + - 'install.sh' pull_request: branches: [trunk] paths-ignore: - 'docs/**' - 'README.md' + - 'install.sh' jobs: build: diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index a3e74bc..d5625f4 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -6,6 +6,7 @@ on: paths-ignore: - 'docs/**' - 'README.md' + - 'install.sh' jobs: e2e-tests: diff --git a/.github/workflows/test-install-script.yaml b/.github/workflows/test-install-script.yaml new file mode 100644 index 0000000..13c2d59 --- /dev/null +++ b/.github/workflows/test-install-script.yaml @@ -0,0 +1,19 @@ +name: Test Install Script + +on: + pull_request: + branches: [trunk] + paths: + - 'install.sh' + +jobs: + test-install-script: + name: Test Install Script + runs-on: elvia-runner + steps: + - name: Test install script + run: | + curl -fsSL "https://raw.githubusercontent.com/3lvia/cli/$COMMIT_SHA/install.sh" | bash + 3lv + env: + COMMIT_SHA: ${{ github.event.pull_request.head.sha }}