diff --git a/action.yml b/action.yml index 7b86d2c..677a549 100644 --- a/action.yml +++ b/action.yml @@ -30,13 +30,38 @@ runs: using: "composite" steps: + - name: Download TeX Live distribution and create hash (Windows) + if: runner.os == 'Windows' + shell: powershell + run: | + ## Check into temporary folder + Set-Location -Path ${{ runner.temp }} + ## Download installer + Invoke-WebRequest http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip -OutFile install-tl.zip + ## Generate hash and save it + $fileHash = (Get-FileHash install-tl.zip).Hash + $envString = "texlive_install_hash=" + $fileHash + echo $envString | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + + - name: Download TeX Live distribution and create hash (Linux or macOS) + if: runner.os != 'Windows' && steps.cache-texlive.outputs.cache-hit != 'true' + shell: bash + run: | + # Install TeX Live distribution (Linux or macOS) + ## Check into temporary folder + cd ${{ runner.temp }} + ## Download installer + wget --quiet http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz + ## Generate hash and save it + echo "texlive_install_hash=$(shasum -a 256 install-tl-unx.tar.gz | cut -f 1 -d " ")" >> $GITHUB_ENV + - name: Cache TeX Live installation uses: actions/cache@v2 id: cache-texlive if: inputs.cache-enabled == 'true' with: path: ${{ inputs.installation-path }} - key: ${{ inputs.cache-key }}-${{ hashFiles(inputs.profile-path, inputs.packages-path) }} + key: ${{ inputs.cache-key }}-${{ env.texlive_install_hash }}-${{ hashFiles(inputs.profile-path, inputs.packages-path) }} restore-keys: ${{ inputs.cache-key }}- - name: Install TeX Live distribution (Windows) @@ -49,8 +74,6 @@ runs: # Install TeX Live distribution (Windows) ## Check into temporary folder Set-Location -Path ${{ runner.temp }} - ## Download installer - Invoke-WebRequest http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip -OutFile install-tl.zip ## Unpack installer Expand-Archive -Path install-tl.zip -DestinationPath . ## Check into unpacked installer folder @@ -67,8 +90,6 @@ runs: # Install TeX Live distribution (Linux or macOS) ## Check into temporary folder cd ${{ runner.temp }} - ## Download installer - wget --quiet http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz ## Unpack installer tar -xzf install-tl-unx.tar.gz ## Check into unpacked installer folder