From 828f3e9de680ee582d66d52eb81f2e3a2ca7b5bb Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 6 Feb 2025 15:55:47 +0400 Subject: [PATCH 1/3] windows for uv installation --- actions/environment/uv/action.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/actions/environment/uv/action.yml b/actions/environment/uv/action.yml index dff2b68f..4bcac1a3 100644 --- a/actions/environment/uv/action.yml +++ b/actions/environment/uv/action.yml @@ -35,10 +35,21 @@ runs: - name: Install uv shell: bash run: | - curl -LsSf https://astral.sh/uv/install.sh | sh - echo "$HOME/.local/bin" >> $GITHUB_PATH # Add UV binary directory to PATH in GitHub Actions environment - export PATH="$HOME/.local/bin:$PATH" # Add UV binary directory to PATH for the current shell session - uv --version # Verify UV installation + set -eo pipefail + if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "macOS" ]; then + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + export PATH="$HOME/.local/bin:$PATH" + elif [ "$RUNNER_OS" == "Windows" ]; then + pwsh -Command "irm https://astral.sh/uv/install.ps1 | iex" + echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH + export PATH="$APPDATA/Python/Scripts:$PATH" + else + echo "Unsupported operating system: $RUNNER_OS" + exit 1 + fi + uv --version + uv --help > /dev/null - name: Set up Python environment with uv shell: bash From 412a89c66e15c77b466e18a43112e01782ec51ed Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 6 Feb 2025 15:58:29 +0400 Subject: [PATCH 2/3] windows for uv installation --- actions/environment/uv/action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/actions/environment/uv/action.yml b/actions/environment/uv/action.yml index 4bcac1a3..5b744649 100644 --- a/actions/environment/uv/action.yml +++ b/actions/environment/uv/action.yml @@ -42,12 +42,19 @@ runs: export PATH="$HOME/.local/bin:$PATH" elif [ "$RUNNER_OS" == "Windows" ]; then pwsh -Command "irm https://astral.sh/uv/install.ps1 | iex" - echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH - export PATH="$APPDATA/Python/Scripts:$PATH" + WINDOWS_UV_PATH="C:\\Users\\runneradmin\\.local\\bin" + echo "$WINDOWS_UV_PATH" >> $GITHUB_PATH + export PATH="$WINDOWS_UV_PATH:$PATH" + # Reload PATH in the current shell for Windows + eval "$(echo 'export PATH="'"$WINDOWS_UV_PATH"':$PATH"')" else echo "Unsupported operating system: $RUNNER_OS" exit 1 fi + # Small delay to allow PATH to update + sleep 2 + # Print PATH for debugging + echo "Current PATH: $PATH" uv --version uv --help > /dev/null From 4eeaed9ed7f00886f29a3847c2b2336e8114eaa8 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 6 Feb 2025 16:04:10 +0400 Subject: [PATCH 3/3] windows for uv installation --- actions/environment/uv/action.yml | 36 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/actions/environment/uv/action.yml b/actions/environment/uv/action.yml index 5b744649..dcf14b66 100644 --- a/actions/environment/uv/action.yml +++ b/actions/environment/uv/action.yml @@ -32,32 +32,28 @@ runs: uses: actions/checkout@v4 # Install UV - - name: Install uv + - name: Install UV (Unix) + if: runner.os == 'Linux' || runner.os == 'macOS' shell: bash run: | set -eo pipefail - if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "macOS" ]; then - curl -LsSf https://astral.sh/uv/install.sh | sh - echo "$HOME/.local/bin" >> $GITHUB_PATH - export PATH="$HOME/.local/bin:$PATH" - elif [ "$RUNNER_OS" == "Windows" ]; then - pwsh -Command "irm https://astral.sh/uv/install.ps1 | iex" - WINDOWS_UV_PATH="C:\\Users\\runneradmin\\.local\\bin" - echo "$WINDOWS_UV_PATH" >> $GITHUB_PATH - export PATH="$WINDOWS_UV_PATH:$PATH" - # Reload PATH in the current shell for Windows - eval "$(echo 'export PATH="'"$WINDOWS_UV_PATH"':$PATH"')" - else - echo "Unsupported operating system: $RUNNER_OS" - exit 1 - fi - # Small delay to allow PATH to update - sleep 2 - # Print PATH for debugging - echo "Current PATH: $PATH" + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + export PATH="$HOME/.local/bin:$PATH" uv --version uv --help > /dev/null + - name: Install UV (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + irm https://astral.sh/uv/install.ps1 | iex + $uvPath = "C:\Users\runneradmin\.local\bin" + Add-Content $env:GITHUB_PATH $uvPath + $env:Path = "$uvPath;" + $env:Path + uv --version + uv --help > $null + - name: Set up Python environment with uv shell: bash working-directory: ${{ inputs.working-directory }}