@@ -14,10 +14,13 @@ jobs:
1414 - name: Create linux package
1515 run: |
1616 make debpkg
17+ mkdir linux-release-candidate
18+ cp linux/artifacts/*.deb linux-release-candidate/
19+ cp linux/artifacts/*.tar.gz linux-release-candidate/
1720 - uses: actions/upload-artifact@master
1821 with:
1922 name: linux-release-candidate
20− path: linux-artifacts
23+ path: linux-release-candidate
2124
2225 windows:
2326
@@ -25,31 +28,33 @@ jobs:
2528 strategy:
2629 fail-fast: true
2730 matrix:
28− - osarch: "windows-x86_64"
29− arch: "x86"
30− choco_opts: "--x86"
31− stack_opts: ""
32− - osarch: "windows-i386"
33− arch: "x64"
34− choco_opts: ""
35− stack_opts: "--flag hslua:lua_32bits"
31+ versions:
32+ - osarch: "windows-x86_64"
33+ arch: "x64"
34+ choco_opts: ""
35+ stack_opts: ""
36+ - osarch: "windows-i386"
37+ arch: "x86"
38+ choco_opts: "--x86"
39+ stack_opts: "--flag hslua:lua_32bits"
3640
3741 steps:
3842 - uses: actions/checkout@v1
3943 - name: Install stack
4044 shell: cmd
4145 run: |
42− choco install haskell-stack ${{ matrix.choco_opts }}
46+ choco install haskell-stack ${{ matrix.versions.choco_opts }}
4347 - name: Install dependencies
4448 run: |
4549 stack update
46− stack build ${{ matrix.stack_opts }} --dependencies-only pandoc pandoc-citeproc
47− - name: Build artifacts
50+ stack build ${{ matrix.versions.stack_opts }} --dependencies-only pandoc pandoc-citeproc
51+ - name: Create windows package
4852 shell: cmd
4953 run: |
5054 for /f %%a in ('powershell -Command "Get-Date -format yyyy-MM-dd"') do set THEDATE=%%a
51− stack build ${{ matrix.stack_opts }}pandoc pandoc-citeproc
52− forfiles /P .\.stack-work\install /M pandoc*.exe /S /C "cmd /C copy @path windows"
55+ stack build ${{ matrix.versions.stack_opts }}pandoc pandoc-citeproc
56+ @set WINDOWS=%CD%\windows
57+ forfiles /P .\.stack-work\install /M pandoc*.exe /S /C "cmd /C echo @path && echo %%WINDOWS%% && copy @path %%WINDOWS%%"
5358 stack exec pandoc -- -s --toc MANUAL.txt -o windows\MANUAL.html
5459 stack exec pandoc -- -s COPYING.md -t rtf -o windows\COPYING.rtf
5560 copy COPYRIGHT windows\COPYRIGHT.txt
@@ -65,43 +70,77 @@ jobs:
6570 )
6671 echo Detected version %VERSION%
6772 echo Creating msi...
68− candle -arch ${{ matrix.arch }} -dVERSION=%VERSION% -dBINPATH=%BINPATH% *.wxs -out wixobj\
73+ dir
74+ @set WIXBIN="c:\Program Files (x86)\WiX Toolset v3.11\bin"
75+ @set WORKDIR=%CD%
76+ echo Running candle...
77+ %WIXBIN%\candle -arch ${{ matrix.versions.arch }} -dVERSION=%VERSION% -dBINPATH=%WORKDIR% *.wxs -out wixobj\
6978 if %errorlevel% neq 0 exit /b %errorlevel%
70− light -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc Pandoc-en-us.wxl -out pandoc-%VERSION%-${{ matrix.osarch }}.msi wixobj\*.wixobj
79+ echo Running light...
80+ %WIXBIN%\light -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc Pandoc-en-us.wxl -out %WORKDIR%\pandoc-%VERSION%-${{ matrix.versions.osarch }}.msi wixobj\*.wixobj
7181 cd ..
7282 mkdir windows-release-candidate
73− copy windows\pandoc-%VERSION%-${{ matrix.osarch }}.msi windows-release-candidate
83+ copy windows\pandoc-%VERSION%-${{ matrix.versions.osarch }}.msi windows-release-candidate
7484 - uses: actions/upload-artifact@master
7585 with:
7686 name: windows-release-candidate
7787 path: windows-release-candidate
7888
79−# macos:
89+ macos:
8090
81−# runs-on: macOS-latest
91+ runs-on: macOS-latest
8292
83−# steps:
84−# - uses: actions/checkout@v1
85−# - name: Install stack
86−# run: |
87−# curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz
88−# tar xzvf stack.tar.gz --strip-components=1 'stack*/stack'
89−# - name: Install dependencies
90−# run: |
91−# ./stack update
92−# ./stack build --dependencies-only pandoc pandoc-citeproc
93−# - name: Build artifacts
94−# run: |
95−# export ARTIFACTS=nightly-macos/pandoc-nightly-macos-$(date +%Y-%m-%d)
96−# mkdir -p ${ARTIFACTS}
97−# ./stack build pandoc pandoc-citeproc
98−# for f in $(find .stack-work/install -name 'pandoc*' -perm +001 -type f); do cp $f ${ARTIFACTS}/; done
99−# mv ${ARTIFACTS}/pandoc ${ARTIFACTS}/pandoc
100−# mv ${ARTIFACTS}/pandoc-citeproc ${ARTIFACTS}/pandoc-citeproc
101−# cp COPYRIGHT ${ARTIFACTS}/
102−# echo "Built from ${GITHUB_SHA}" > ${ARTIFACTS}/README.nightly.txt
103−# - uses: actions/upload-artifact@master
104−# with:
105−# name: nightly-macos
106−# path: nightly-macos
93+ steps:
94+ - uses: actions/checkout@v1
95+ - name: Install stack
96+ run: |
97+ curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz
98+ tar xzvf stack.tar.gz --strip-components=1 'stack*/stack'
99+ - name: Install dependencies
100+ run: |
101+ ./stack update
102+ ./stack build --dependencies-only pandoc pandoc-citeproc
103+ - name: Create macOS package
104+ run: |
105+ export VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $$2;}')
106+ export BASEDIR=$(pwd)
107+ export ARTIFACTS=${BASEDIR}/macos-release-candidate
108+ export DIST=${BASEDIR}/macos_package
109+ export RESOURCES=${ARTIFACTS}/Resources
110+ export ROOT=${DIST}/pandoc
111+ export DEST=${ROOT}/usr/local
112+ export ME=$(whoami)
113+ export BASE=pandoc-$VERSION
114+ mkdir -p ${ARTIFACTS}
115+ mkdir -p ${DIST}
116+ mkdir -p ${RESOURCES}
117+ mkdir -p ${DEST}/bin
118+ mkdir -p ${DEST}/share/man/man1
119+ ./stack build pandoc pandoc-citeproc
120+ for f in $(find .stack-work/install -name 'pandoc*' -perm +001 -type f); do cp $f ${DEST}/bin/; done
121+ strip ${DEST}/bin/pandoc
122+ strip ${DEST}/bin/pandoc-citeproc
123+ ${DEST}/bin/pandoc -f markdown-smart -t man -s \
124+ --template man/pandoc.1.template --lua-filter man/manfilter.lua \
125+ --variable version="pandoc ${VERSION}" \
126+ -o ${DEST}/share/man/man1/pandoc.1
127+ ${DEST}/bin/pandoc-citeproc --man > \
128+ $DEST/share/man/man1/pandoc-citeproc.1
129+ ${DEST}/bin/pandoc -t html5 -s COPYING.md -Vpagetitle=License \
130+ -o ${RESOURCES}/license.html
131+ sed -e "s/PANDOCVERSION/${VERSION}/" macos/distribution.xml.in > ${ARTIFACTS}/distribution.xml
132+
133+ chown -R $ME:staff ${DIST}
134+ echo Creating pkg...
135+ pkgbuild --root $ROOT --identifier net.johnmacfarlane.pandoc --version $VERSION --ownership recommended ${ARTIFACTS}/pandoc.pkg
136+ echo Creating zip...
137+ cd ${DEST}
138+ cd ..
139+ mv local ${BASE}
140+ zip -r ${ARTIFACTS}/${BASE}-macOS.zip ${BASE}
141+ echo -e "${BASE}-macOS.pkg: pandoc.pkg\n\tproductbuild --distribution distribution.xml --resources Resources --package-path $< --version ${VERSION} --sign 'Developer ID Installer: John Macfarlane' -o \$@\n" > ${ARTIFACTS}/Makefile
142+ - uses: actions/upload-artifact@master
143+ with:
144+ name: macos-release-candidate
145+ path: macos-release-candidate
107146