diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df0f1a27c..254799af5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,3 +83,24 @@ jobs: - name: Publish AOT run: dotnet run --project build -c release -- publishbinaries + + install-script: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} - ${{ matrix.command }} + env: + INSTALL_SCRIPT: https://raw.githubusercontent.com/elastic/docs-builder/${{ github.sha }}/install.sh + INSTALL_SCRIPT_PWSH: https://raw.githubusercontent.com/elastic/docs-builder/${{ github.sha }}/install.ps1 + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + command: curl -sL https://raw.githubusercontent.com/elastic/docs-builder/${{ github.sha }}/install.sh | sh + - os: macos-latest + command: curl -sL https://raw.githubusercontent.com/elastic/docs-builder/${{ github.sha }}/install.sh | sh + - os: windows-latest + command: iex (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/elastic/docs-builder/${{ github.sha }}/install.ps1') + steps: + - uses: actions/checkout@v4 + - run: ${{ matrix.command }} + - run: docs-builder --help diff --git a/install.sh b/install.sh index 163ce3279..07da436e4 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ -#!/bin/sh -set -euo pipefail +#!/usr/bin/env bash +set -eu # Determine OS type and architecture OS=$(uname -s | tr '[:upper:]' '[:lower:]') @@ -7,7 +7,7 @@ ARCH=$(uname -m) # Map architecture naming if [ "$ARCH" = "x86_64" ]; then - ARCH="amd64" + ARCH="x64" elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then ARCH="arm64" fi @@ -36,7 +36,7 @@ fi # Check if docs-builder already exists, but handle non-interactive shells if [ -f "$INSTALL_DIR/docs-builder" ]; then echo "docs-builder is already installed." - + # Check if script is running interactively (has a TTY) if [ -t 0 ]; then # Running interactively, can prompt for input @@ -88,4 +88,4 @@ fi rm -f "$BINARY" echo "docs-builder has been installed successfully and is available in your PATH." -echo "You can run 'docs-builder --help' to see available commands." \ No newline at end of file +echo "You can run 'docs-builder --help' to see available commands."