Skip to content

Commit

Permalink
chore: Download assets using gh release download
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jul 27, 2024
1 parent e90e80d commit fa62fdf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ runs:
echo "Installing yampl $VERSION..."
DEST="$RUNNER_TEMP/yampl"
URL="$(jq -r --arg OS "$OS" \
'.assets[] | select(.name | ascii_downcase | test($OS + "_(amd64|x86_64).(tar.gz|zip)$")) | .url' \
ASSET="$(jq -r --arg OS "$OS" \
'.assets[].name | select(ascii_downcase | test($OS + "_(amd64|x86_64).(tar.gz|zip)$"))' \
<<<"$RELEASE" \
)"
echo "Downloading $URL"
echo "Downloading $ASSET"
mkdir -p "$DEST"
cd "$DEST"
case "$URL" in
case "$ASSET" in
*.tar.gz)
curl -sfL "$URL" | tar -xzf - "$FILENAME";;
gh release download "$VERSION" --pattern="$ASSET" --output=- | tar -xzf - "$FILENAME";;
*.zip)
curl -sfL -o app.zip "$URL"
gh release download "$VERSION" --pattern="$ASSET" --output=app.zip
unzip -o app.zip "$FILENAME"
rm app.zip
;;
Expand Down

0 comments on commit fa62fdf

Please sign in to comment.