Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
lsegurado committed Sep 22, 2024
1 parent ec910d2 commit c67a2e0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@ description: "Setup runtime"
runs:
using: "composite"
steps:
- name: Extract Bun version from package.json (default to latest)
id: extract-bun-version
shell: bash
run: |
BUN_VERSION=$(cat package.json | grep '"packageManager":' | grep -o 'bun@[0-9.]*' | cut -d'@' -f2 || echo "latest")
echo "BUN_VERSION=$BUN_VERSION" >> $GITHUB_ENV
- name: Set bun download URL
id: set-bun-url
shell: bash
run: |
if [[ "$BUN_VERSION" == "latest" ]]; then
BASE_URL="https://github.com/oven-sh/bun/releases/latest/download"
else
BASE_URL="https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}"
fi
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "BUN_URL=https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip" >> $GITHUB_ENV
echo "BUN_URL=$BASE_URL/bun-linux-x64.zip" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
echo "BUN_URL=https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64.zip" >> $GITHUB_ENV
echo "BUN_URL=$BASE_URL/bun-windows-x64.zip" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "BUN_URL=https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-x64.zip" >> $GITHUB_ENV
echo "BUN_URL=$BASE_URL/bun-darwin-x64.zip" >> $GITHUB_ENV
fi
- name: Setup
Expand Down

0 comments on commit c67a2e0

Please sign in to comment.