From 27278467036fd5679e7bdd203c1e508db4b33f6e Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Jan 2022 17:30:43 +0100 Subject: [PATCH 1/7] download from URL directly when specific version if set --- install-quarto/action.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/install-quarto/action.yml b/install-quarto/action.yml index d3dcab1..bc93424 100644 --- a/install-quarto/action.yml +++ b/install-quarto/action.yml @@ -13,36 +13,36 @@ runs: # Select correct bundle for OS type case $RUNNER_OS in "Linux") - echo "BUNDLE_EXT=deb" >> $GITHUB_ENV + echo "BUNDLE_EXT=linux-amd64.deb" >> $GITHUB_ENV ;; "macOS") - echo "BUNDLE_EXT=pkg" >> $GITHUB_ENV + echo "BUNDLE_EXT=macos.pkg" >> $GITHUB_ENV ;; "Windows") - echo "BUNDLE_EXT=msi" >> $GITHUB_ENV + echo "BUNDLE_EXT=win.msi" >> $GITHUB_ENV ;; *) echo "$RUNNER_OS not supported" exit 1 ;; esac - # set version - if [ ! -z "${{inputs.version}}" ] - then - echo "QUARTO_VERSION=v${{inputs.version}}" >> $GITHUB_ENV - fi shell: bash - name: 'Download Quarto release' id: download-quarto env: GITHUB_TOKEN: ${{ github.token }} run: | - # download the latest release if [ ${{ runner.os }} != "Windows" ]; then - # On Windows scoop will be used so no need to download the release - gh release download ${{env.QUARTO_VERSION}} --repo quarto-dev/quarto-cli --pattern ${{ format('*.{0}', env.BUNDLE_EXT) }} - echo "::set-output name=installer::$(ls quarto*.$BUNDLE_EXT)" + # On Windows scoop will be used so no need to download the release + if [ -z "${{inputs.version}}" ]; then + # download the latest release + gh release download --repo quarto-dev/quarto-cli --pattern ${{ format('*.{0}', env.BUNDLE_EXT) }} + else + # download a specific release + wget https://github.com/quarto-dev/quarto-cli/releases/download/v${{inputs.version}}/quarto-${{inputs.version}}-${{env.BUNDLE_EXT}} + fi fi + echo "::set-output name=installer::$(ls quarto*${{ env.BUNDLE_EXT }})" shell: bash - name: 'Install Quarto' run: | From b885569c9e004021d89f75a21ddfcc287676057f Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Jan 2022 17:37:45 +0100 Subject: [PATCH 2/7] Change the pattern for matching file --- install-quarto/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-quarto/action.yml b/install-quarto/action.yml index bc93424..db2e441 100644 --- a/install-quarto/action.yml +++ b/install-quarto/action.yml @@ -36,7 +36,7 @@ runs: # On Windows scoop will be used so no need to download the release if [ -z "${{inputs.version}}" ]; then # download the latest release - gh release download --repo quarto-dev/quarto-cli --pattern ${{ format('*.{0}', env.BUNDLE_EXT) }} + gh release download --repo quarto-dev/quarto-cli --pattern ${{ format('*{0}', env.BUNDLE_EXT) }} else # download a specific release wget https://github.com/quarto-dev/quarto-cli/releases/download/v${{inputs.version}}/quarto-${{inputs.version}}-${{env.BUNDLE_EXT}} From 1309c56f81e14c71a507719179809189baf188e8 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Jan 2022 17:40:41 +0100 Subject: [PATCH 3/7] Fix issue with windows install when no version is specified --- install-quarto/install-quarto-windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-quarto/install-quarto-windows.ps1 b/install-quarto/install-quarto-windows.ps1 index bde37d9..060ae81 100644 --- a/install-quarto/install-quarto-windows.ps1 +++ b/install-quarto/install-quarto-windows.ps1 @@ -17,7 +17,7 @@ Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH -param ($version) +param ($version='') scoop bucket add r-bucket https://github.com/cderv/r-bucket.git if ([string]::IsNullOrEmpty($version)) { scoop install quarto From b7fd486ea3dcdd5ad2a49a38611f5c7e0db056ff Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Jan 2022 17:44:18 +0100 Subject: [PATCH 4/7] QUARTO_VERSION is no more used --- install-quarto/action.yml | 4 ++-- install-quarto/install-quarto-windows.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install-quarto/action.yml b/install-quarto/action.yml index db2e441..edb1f46 100644 --- a/install-quarto/action.yml +++ b/install-quarto/action.yml @@ -57,11 +57,11 @@ runs: ;; "Windows") # can't install msi for now so use scoop - if [ -z "${{ env.QUARTO_VERSION }}" ] + if [ -z "${{ inputs.version }}" ] then powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 else - powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 -version ${{ env.QUARTO_VERSION }} + powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 -version ${{ inputs.version }} fi ;; *) diff --git a/install-quarto/install-quarto-windows.ps1 b/install-quarto/install-quarto-windows.ps1 index 060ae81..bde37d9 100644 --- a/install-quarto/install-quarto-windows.ps1 +++ b/install-quarto/install-quarto-windows.ps1 @@ -17,7 +17,7 @@ Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH -param ($version='') +param ($version) scoop bucket add r-bucket https://github.com/cderv/r-bucket.git if ([string]::IsNullOrEmpty($version)) { scoop install quarto From f6ee27f578f878f5ab7413b657f44a9692cdc925 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Jan 2022 17:50:11 +0100 Subject: [PATCH 5/7] param() is not supported in windows powershell in GHA --- install-quarto/action.yml | 2 +- install-quarto/install-quarto-windows.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install-quarto/action.yml b/install-quarto/action.yml index edb1f46..98fdbcb 100644 --- a/install-quarto/action.yml +++ b/install-quarto/action.yml @@ -61,7 +61,7 @@ runs: then powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 else - powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 -version ${{ inputs.version }} + powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 ${{ inputs.version }} fi ;; *) diff --git a/install-quarto/install-quarto-windows.ps1 b/install-quarto/install-quarto-windows.ps1 index bde37d9..d9c4fca 100644 --- a/install-quarto/install-quarto-windows.ps1 +++ b/install-quarto/install-quarto-windows.ps1 @@ -17,7 +17,7 @@ Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH -param ($version) +$version=$args[0] scoop bucket add r-bucket https://github.com/cderv/r-bucket.git if ([string]::IsNullOrEmpty($version)) { scoop install quarto From 3387e96be7c78dfce3f43176bc77c35fa0983934 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Jan 2022 17:53:23 +0100 Subject: [PATCH 6/7] do not retrieve bundle name on Windows --- install-quarto/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-quarto/action.yml b/install-quarto/action.yml index 98fdbcb..1033d7d 100644 --- a/install-quarto/action.yml +++ b/install-quarto/action.yml @@ -41,8 +41,8 @@ runs: # download a specific release wget https://github.com/quarto-dev/quarto-cli/releases/download/v${{inputs.version}}/quarto-${{inputs.version}}-${{env.BUNDLE_EXT}} fi - fi echo "::set-output name=installer::$(ls quarto*${{ env.BUNDLE_EXT }})" + fi shell: bash - name: 'Install Quarto' run: | From 8ee17143fd7fb23aac4c2e41ed8a741bb5a13859 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 31 Jan 2022 17:58:30 +0100 Subject: [PATCH 7/7] Update README --- install-quarto/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install-quarto/README.md b/install-quarto/README.md index 39543c2..1a80623 100644 --- a/install-quarto/README.md +++ b/install-quarto/README.md @@ -7,7 +7,8 @@ Install a Quarto release (https://github.com/quarto-dev/quarto-cli/releases) usi This action will: * Download the Github Release of Quarto on Mac and Linux and install it -* On Windows, it will for now use Scoop to install Quarto, as we have still an issue with Quarto MSI on Github Action (https://github.com/quarto-dev/quarto-cli/issues/108) +* On Windows, it will for now use **Scoop** (https://github.com/ScoopInstaller/Scoop) to install Quarto, as we have still an issue with Quarto MSI on Github Action (https://github.com/quarto-dev/quarto-cli/issues/108). (**Scoop** will be installed on the runner by the action) +* On Linux and MacOS, it will use **gh** CLI to download the last available bundle (no `version` specified as input). If you don't have **gh** on your Github Action runner, you can specify a fix `version` to directly download from a URL using `wget`. Inputs available