Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Ecspresso into toolchain cache directory, show installed versions #567

Merged
merged 15 commits into from
May 16, 2023
Merged
9 changes: 9 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,17 @@ jobs:
version-file: tests/.ecspresso-version
- run: |
ecspresso version 2>&1 | fgrep v2.0.0

- run: |
rm -f /usr/local/bin/ecspresso

- uses: kayac/ecspresso@v2-action-testing
with:
version: latest
- run: |
ecspresso version 2>&1 | fgrep v2.
- uses: kayac/ecspresso@v2-action-testing
with:
version: v2.0.4
- run: |
ecspresso version 2>&1 | fgrep v2.0.4
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ runs:
else
DOWNLOAD_URL=https://github.com/kayac/ecspresso/releases/download/${VERSION}/ecspresso_${VERSION:1}_linux_amd64.tar.gz
fi
mkdir -p ${RUNNER_TOOL_CACHE}/ecspresso
cd /tmp
curl -sfLO ${DOWNLOAD_URL}
if [[ "${DOWNLOAD_URL}" =~ \.tar\.gz$ ]]; then
FILENAME=$(basename $DOWNLOAD_URL .tar.gz)
tar xzvf ${FILENAME}.tar.gz
sudo install ecspresso /usr/local/bin/ecspresso
sudo install ecspresso ${RUNNER_TOOL_CACHE}/ecspresso/ecspresso
elif [[ "${DOWNLOAD_URL}" =~ \.zip$ ]]; then
FILENAME=$(basename $DOWNLOAD_URL .zip)
unzip ${FILENAME}.zip
sudo install ${FILENAME} /usr/local/bin/ecspresso
sudo install ${FILENAME} ${RUNNER_TOOL_CACHE}/ecspresso/ecspresso
fi

echo "Adding ${RUNNER_TOOL_CACHE}/ecspresso to path..."
echo "${RUNNER_TOOL_CACHE}/ecspresso" >> $GITHUB_PATH
"${RUNNER_TOOL_CACHE}/ecspresso/ecspresso" version