Skip to content

Commit

Permalink
Add support for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tarleb committed Oct 17, 2024
1 parent b2845d5 commit 0a36a2f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 12 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'README.md'

jobs:
linux:
Linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -33,7 +33,7 @@ jobs:
[ "pandoc ${{ matrix.version }}" = "$(pandoc -v | head -n1)" ]
fi
macos:
macOS:
runs-on: macos-15
strategy:
fail-fast: false
Expand All @@ -55,3 +55,27 @@ jobs:
# check that we got the right version
[ "pandoc ${{ matrix.version }}" = "$(pandoc -v | head -n1)" ]
fi
Windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
version:
- '3.1.13'
-
steps:
- name: Install pandoc
uses: pandoc/actions/setup@main
with:
version: ${{ matrix.version }}
- name: Verify
shell: bash
run: |
if [ -z "${{ matrix.version }}" ]; then
# just check that pandoc is available
pandoc -v
else
# check that we got the right version
[ "pandoc ${{ matrix.version }}" = "$(pandoc -v | head -n1)" ]
fi
30 changes: 20 additions & 10 deletions setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ runs:
printf 'INSTALLER_SUFFIX=x86_64-macOS.pkg\n' >> $GITHUB_ENV
fi
;;
("Windows")
printf 'INSTALLER_SUFFIX=windows-x86_64.zip\n' >> $GITHUB_ENV
;;
(*)
printf 'Do not know how to install pandoc on %s\n' "$RUNNER_OS"
exit 1
Expand All @@ -60,15 +63,22 @@ runs:
INSTALLER: pandoc-${{ env.PANDOC_VERSION }}-${{ env.INSTALLER_SUFFIX }}
run: |
case $RUNNER_OS in
"Linux")
sudo apt install ./$INSTALLER
;;
"macOS")
sudo installer -pkg ./$INSTALLER -target '/'
;;
*)
echo "$RUNNER_OS not supported"
exit 1
;;
("Linux")
sudo apt install ./$INSTALLER
;;
("macOS")
sudo installer -pkg ./$INSTALLER -target '/'
;;
("Windows")
unzip "$INSTALLER"
mv pandoc-${{ env.PANDOC_VERSION }}/pandoc /usr/bin/pandoc
rm -rf pandoc-${{ env.PANDOC_VERSION }}
;;
(*)
echo "$RUNNER_OS not supported"
exit 1
;;
esac
# Cleanup
rm $INSTALLER

0 comments on commit 0a36a2f

Please sign in to comment.