git.iko.soy/typeable/pandoc
on master help sign in
Update release-candidate.yml for GitHub actions.
d40349dJohn MacFarlane
.github/workflows/release-candidate.yml+82−43
@@ -14,10 +14,13 @@ jobs:
14 - name: Create linux package
14 - name: Create linux package
15 run: |
15 run: |
16 make debpkg
16 make debpkg
17+ mkdir linux-release-candidate
18+ cp linux/artifacts/*.deb linux-release-candidate/
19+ cp linux/artifacts/*.tar.gz linux-release-candidate/
17 - uses: actions/upload-artifact@master
20 - uses: actions/upload-artifact@master
18 with:
21 with:
19 name: linux-release-candidate
22 name: linux-release-candidate
20− path: linux-artifacts
23+ path: linux-release-candidate
21
24
22 windows:
25 windows:
23
26
@@ -25,31 +28,33 @@ jobs:
25 strategy:
28 strategy:
26 fail-fast: true
29 fail-fast: true
27 matrix:
30 matrix:
31+ versions:
28− - osarch: "windows-x86_64"
32+ - osarch: "windows-x86_64"
29− arch: "x86"
33+ arch: "x64"
30− choco_opts: "--x86"
34+ choco_opts: ""
31− stack_opts: ""
35+ stack_opts: ""
32− - osarch: "windows-i386"
36+ - osarch: "windows-i386"
33− arch: "x64"
37+ arch: "x86"
34− choco_opts: ""
38+ choco_opts: "--x86"
35− stack_opts: "--flag hslua:lua_32bits"
39+ stack_opts: "--flag hslua:lua_32bits"
36
40
37 steps:
41 steps:
38 - uses: actions/checkout@v1
42 - uses: actions/checkout@v1
39 - name: Install stack
43 - name: Install stack
40 shell: cmd
44 shell: cmd
41 run: |
45 run: |
42− choco install haskell-stack ${{ matrix.choco_opts }}
46+ choco install haskell-stack ${{ matrix.versions.choco_opts }}
43 - name: Install dependencies
47 - name: Install dependencies
44 run: |
48 run: |
45 stack update
49 stack update
46− stack build ${{ matrix.stack_opts }} --dependencies-only pandoc pandoc-citeproc
50+ stack build ${{ matrix.versions.stack_opts }} --dependencies-only pandoc pandoc-citeproc
47− - name: Build artifacts
51+ - name: Create windows package
48 shell: cmd
52 shell: cmd
49 run: |
53 run: |
50 for /f %%a in ('powershell -Command "Get-Date -format yyyy-MM-dd"') do set THEDATE=%%a
54 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
55+ stack build ${{ matrix.versions.stack_opts }}pandoc pandoc-citeproc
56+ @set WINDOWS=%CD%\windows
52− forfiles /P .\.stack-work\install /M pandoc*.exe /S /C "cmd /C copy @path windows"
57+ forfiles /P .\.stack-work\install /M pandoc*.exe /S /C "cmd /C echo @path && echo %%WINDOWS%% && copy @path %%WINDOWS%%"
53 stack exec pandoc -- -s --toc MANUAL.txt -o windows\MANUAL.html
58 stack exec pandoc -- -s --toc MANUAL.txt -o windows\MANUAL.html
54 stack exec pandoc -- -s COPYING.md -t rtf -o windows\COPYING.rtf
59 stack exec pandoc -- -s COPYING.md -t rtf -o windows\COPYING.rtf
55 copy COPYRIGHT windows\COPYRIGHT.txt
60 copy COPYRIGHT windows\COPYRIGHT.txt
@@ -65,43 +70,77 @@ jobs:
65 )
70 )
66 echo Detected version %VERSION%
71 echo Detected version %VERSION%
67 echo Creating msi...
72 echo Creating msi...
73+ dir
74+ @set WIXBIN="c:\Program Files (x86)\WiX Toolset v3.11\bin"
75+ @set WORKDIR=%CD%
76+ echo Running candle...
68− candle -arch ${{ matrix.arch }} -dVERSION=%VERSION% -dBINPATH=%BINPATH% *.wxs -out wixobj\
77+ %WIXBIN%\candle -arch ${{ matrix.versions.arch }} -dVERSION=%VERSION% -dBINPATH=%WORKDIR% *.wxs -out wixobj\
69 if %errorlevel% neq 0 exit /b %errorlevel%
78 if %errorlevel% neq 0 exit /b %errorlevel%
79+ echo Running light...
70− light -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc Pandoc-en-us.wxl -out pandoc-%VERSION%-${{ matrix.osarch }}.msi wixobj\*.wixobj
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
71 cd ..
81 cd ..
72 mkdir windows-release-candidate
82 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
74 - uses: actions/upload-artifact@master
84 - uses: actions/upload-artifact@master
75 with:
85 with:
76 name: windows-release-candidate
86 name: windows-release-candidate
77 path: windows-release-candidate
87 path: windows-release-candidate
78
88
79−# macos:
89+ macos:
80
90
81−# runs-on: macOS-latest
91+ runs-on: macOS-latest
82
92
83−# steps:
93+ steps:
84−# - uses: actions/checkout@v1
94+ - uses: actions/checkout@v1
85−# - name: Install stack
95+ - name: Install stack
86−# run: |
96+ run: |
87−# curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz
97+ 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'
98+ tar xzvf stack.tar.gz --strip-components=1 'stack*/stack'
89−# - name: Install dependencies
99+ - name: Install dependencies
90−# run: |
100+ run: |
91−# ./stack update
101+ ./stack update
92−# ./stack build --dependencies-only pandoc pandoc-citeproc
102+ ./stack build --dependencies-only pandoc pandoc-citeproc
93−# - name: Build artifacts
103+ - name: Create macOS package
94−# run: |
104+ run: |
105+ export VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $$2;}')
106+ export BASEDIR=$(pwd)
95−# export ARTIFACTS=nightly-macos/pandoc-nightly-macos-$(date +%Y-%m-%d)
107+ export ARTIFACTS=${BASEDIR}/macos-release-candidate
96−# mkdir -p ${ARTIFACTS}
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
97−# ./stack build pandoc pandoc-citeproc
119+ ./stack build pandoc pandoc-citeproc
98−# for f in $(find .stack-work/install -name 'pandoc*' -perm +001 -type f); do cp $f ${ARTIFACTS}/; done
120+ for f in $(find .stack-work/install -name 'pandoc*' -perm +001 -type f); do cp $f ${DEST}/bin/; done
99−# mv ${ARTIFACTS}/pandoc ${ARTIFACTS}/pandoc
121+ strip ${DEST}/bin/pandoc
100−# mv ${ARTIFACTS}/pandoc-citeproc ${ARTIFACTS}/pandoc-citeproc
122+ strip ${DEST}/bin/pandoc-citeproc
101−# cp COPYRIGHT ${ARTIFACTS}/
123+ ${DEST}/bin/pandoc -f markdown-smart -t man -s \
102−# echo "Built from ${GITHUB_SHA}" > ${ARTIFACTS}/README.nightly.txt
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
103−# - uses: actions/upload-artifact@master
142+ - uses: actions/upload-artifact@master
104−# with:
143+ with:
105−# name: nightly-macos
144+ name: macos-release-candidate
106−# path: nightly-macos
145+ path: macos-release-candidate
107
146