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 230566d commit 172f5c2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ 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"
unzip -o app.zip "$FILENAME"
rm app.zip
gh release download "$VERSION" --pattern="$ASSET"
unzip -o "$ASSET" "$FILENAME"
rm "$ASSET"
;;
*)
echo Invalid file type; exit 1;;
Expand Down

0 comments on commit 172f5c2

Please sign in to comment.