Skip to content

Commit

Permalink
chore(action): Download assets using gh release download
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jul 28, 2024
1 parent e69bec0 commit a9db3c6
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 @@ -67,21 +67,21 @@ runs:
echo "Installing changelog generator $VERSION..."
DEST="$RUNNER_TEMP/changelog-generator"
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 app.zip "$FILENAME"
rm app.zip
gh release download "$VERSION" --pattern="$ASSET"
unzip "$ASSET" "$FILENAME"
rm "$ASSET"
;;
*)
echo Invalid file type; exit 1;;
Expand Down

0 comments on commit a9db3c6

Please sign in to comment.