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 latest Quarto 1.5 or higher, in case Quarto < 1.5.29 #73

Merged
merged 5 commits into from
May 21, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,26 @@ runs:
run: |
${GITHUB_ACTION_PATH}/dependencies.R
[ ! -f "./template.qmd" ] && cp ${GITHUB_ACTION_PATH}/template.qmd . || echo "./template.qmd already exists"
if [[ "$(echo -e "$(quarto --version)\n1.4.0" | sort -V | head -1)" == "1.4.0" ]]; then
echo "✅ Quarto CLI version sufficient (>= 1.4.0)"
if [[ "$(echo -e "$(quarto --version)\n1.5.29" | sort -V | head -1)" == "1.5.29" ]]; then
walkowif marked this conversation as resolved.
Show resolved Hide resolved
echo "✅ Quarto CLI version sufficient (>= 1.5.29)"
echo "Quarto CLI version: $(quarto --version)"
else
echo "❌ Quarto CLI version insufficient (< 1.4.0)"
echo "❌ Quarto CLI version insufficient (< 1.5.29)"
apt-get update
apt-get install -qy wget jq

walkowif marked this conversation as resolved.
Show resolved Hide resolved
echo "Downloading Quarto CLI..."
# Install newer version of Quarto CLI.
export QUARTO_VERSION="1.4.554"
apt-get update
apt-get install -qy wget
# This gets the latest version number (v1.5 or higher) of Quarto from GitHub releases.
# It assumes that such version number (v1.5 or higher) exists within the last 100 released Quarto versions.
export QUARTO_VERSION="$(curl -L -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/quarto-dev/quarto-cli/releases?per_page=100 \
2>/dev/null | \
jq -r '.[] | select(.tag_name | test("^v1.[5-9]")) | .tag_name' | \
head -1 | \
cut -c2-)"
walkowif marked this conversation as resolved.
Show resolved Hide resolved
echo "Downloading Quarto version = $QUARTO_VERSION"
wget https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb
dpkg -i quarto-${QUARTO_VERSION}-linux-amd64.deb
echo "New Quarto CLI version: $(quarto --version)"
Expand Down
Loading