Skip to content

Commit

Permalink
Merge pull request #437 from tj-actions/chore/switch-back-to-gobinaries
Browse files Browse the repository at this point in the history
chore: switch back to gobinaries
  • Loading branch information
repo-ranger[bot] committed Mar 21, 2023
2 parents 4b8a2dd + f3dc2c1 commit fc3a280
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,39 +94,8 @@ runs:
LATEST_VERSION=${VERSION:-v2.2.4}
echo "Downloading auto-doc $LATEST_VERSION binary..."
# Download the latest version
WINDOWS_TARGET=Windows_x86_64
LINUX_TARGET=Linux_x86_64
MACOS_TARGET=Darwin_x86_64
ARCHIVE=zip
TEMP_DIR=$(mktemp -d)
if [[ $(uname -s) == "Linux" ]]; then
TARGET=$LINUX_TARGET
ARCHIVE=tar.gz
elif [[ $(uname -s) == "Darwin" ]]; then
TARGET=$MACOS_TARGET
ARCHIVE=tar.gz
else
TARGET=$WINDOWS_TARGET
fi
DELAY=10
OUTPUT_FILE="$TEMP_DIR"/auto-doc."$ARCHIVE"
for i in $(seq 1 5); do
curl --connect-timeout 300 -sLf https://github.com/tj-actions/auto-doc/releases/download/"$LATEST_VERSION"/auto-doc_"${LATEST_VERSION/v/}"_"$TARGET"."$ARCHIVE" -o "$OUTPUT_FILE" && break
sleep $DELAY
echo "$i retries"
done
if [[ "$ARCHIVE" == "zip" ]]; then
unzip -q "$OUTPUT_FILE" -d "$TEMP_DIR"
else
tar -xzf "$OUTPUT_FILE" -C "$TEMP_DIR"
fi
chmod +x "$TEMP_DIR"/auto-doc
curl -sf https://gobinaries.com/github.com/tj-actions/auto-doc@$LATEST_VERSION | PREFIX=$TEMP_DIR
BIN_PATH="$TEMP_DIR/auto-doc"
fi
Expand Down

0 comments on commit fc3a280

Please sign in to comment.