From 91e3ef24ebcfd0059d93560b6af1d8ecee50d39c Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 29 Mar 2023 09:15:16 +0200 Subject: [PATCH 1/2] Adapt Pandoc action to new macOS installer Closes #715 --- setup-pandoc/lib/setup-pandoc.js | 3 ++- setup-pandoc/src/setup-pandoc.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/setup-pandoc/lib/setup-pandoc.js b/setup-pandoc/lib/setup-pandoc.js index a079e8cad..c893f81d2 100644 --- a/setup-pandoc/lib/setup-pandoc.js +++ b/setup-pandoc/lib/setup-pandoc.js @@ -87,7 +87,8 @@ exports.getPandoc = getPandoc; function installPandocMac(version) { var _a; return __awaiter(this, void 0, void 0, function* () { - const fileName = util.format("pandoc-%s-macOS.pkg", version); + const is_new_macos_installer = compare(version, "3.1.2", ">=") ? true : false; + const fileName = is_new_macos_installer ? util.format("pandoc-%s-x86_64-macOS.pkg", version) : util.format("pandoc-%s-macOS.pkg", version); const downloadUrl = util.format("https://github.com/jgm/pandoc/releases/download/%s/%s", version, fileName); let downloadPath; try { diff --git a/setup-pandoc/src/setup-pandoc.ts b/setup-pandoc/src/setup-pandoc.ts index 2ea4dadbe..a00099c8c 100644 --- a/setup-pandoc/src/setup-pandoc.ts +++ b/setup-pandoc/src/setup-pandoc.ts @@ -48,7 +48,10 @@ export function getPandoc(version: string): Promise { } async function installPandocMac(version: string): Promise { - const fileName = util.format("pandoc-%s-macOS.pkg", version); + // Since 3.1.2, Pandoc uses cabal instead of stack to build the macOS binary. + const is_new_macos_installer = compare(version, "3.1.2", ">=") ? true : false; + const fileName = is_new_macos_installer ? util.format("pandoc-%s-x86_64-macOS.pkg", version) : util.format("pandoc-%s-macOS.pkg", version); + const downloadUrl = util.format( "https://github.com/jgm/pandoc/releases/download/%s/%s", version, From 687df83bcc5564a0b3da66593ea7c1fca0c5ada4 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 29 Mar 2023 09:25:25 +0200 Subject: [PATCH 2/2] Update setup-pandoc.js --- setup-pandoc/lib/setup-pandoc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup-pandoc/lib/setup-pandoc.js b/setup-pandoc/lib/setup-pandoc.js index c893f81d2..d73a0082d 100644 --- a/setup-pandoc/lib/setup-pandoc.js +++ b/setup-pandoc/lib/setup-pandoc.js @@ -87,7 +87,8 @@ exports.getPandoc = getPandoc; function installPandocMac(version) { var _a; return __awaiter(this, void 0, void 0, function* () { - const is_new_macos_installer = compare(version, "3.1.2", ">=") ? true : false; + // Since 3.1.2, Pandoc uses cabal instead of stack to build the macOS binary. + const is_new_macos_installer = (0, compare_versions_1.compare)(version, "3.1.2", ">=") ? true : false; const fileName = is_new_macos_installer ? util.format("pandoc-%s-x86_64-macOS.pkg", version) : util.format("pandoc-%s-macOS.pkg", version); const downloadUrl = util.format("https://github.com/jgm/pandoc/releases/download/%s/%s", version, fileName); let downloadPath;