Pandoc is a simple multi binary setup.
🟦 It does not really require a complicated action or a docker container to quickly bootstrap this on linux or when using it in a github action.
We will bootstrap these binaries with two commands.
pandoc
pandoc-lua
pandoc-server
Get the latest github tag and set it to the variable pandoc_git_tag
pandoc_git_tag="$(git ls-remote -q -t --refs https://github.com/jgm/pandoc.git | awk '/tags\/[0-9]/{sub("refs/tags/", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n 1)"
Download and auto extract the binary to a location of your choosing. In this example we use $(pwd)
# with curl
curl -sLo- "https://github.com/jgm/pandoc/releases/latest/download/pandoc-${pandoc_git_tag}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C "$(pwd)" --exclude="share"
# with wget
wget -q -O- "https://github.com/jgm/pandoc/releases/latest/download/pandoc-${pandoc_git_tag}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C "$(pwd)" --exclude="share"
Check the version.
./pandoc --version
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pandoc - Bootstrap
run: |
pandoc_git_tag="$(git ls-remote -q -t --refs https://github.com/jgm/pandoc.git | awk '/tags\/[0-9]/{sub("refs/tags/", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n 1)"
curl -sLo- "https://github.com/jgm/pandoc/releases/latest/download/pandoc-${pandoc_git_tag}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C "$(pwd)" --exclude="share"
- name: Pandoc - version
run: ./pandoc --version