summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release-candidate.yml30
-rw-r--r--macos/make_macos_release.sh35
2 files changed, 37 insertions, 28 deletions
diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml
index fe48c34e6..dd71748ca 100644
--- a/.github/workflows/release-candidate.yml
+++ b/.github/workflows/release-candidate.yml
@@ -90,35 +90,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Build executable
+ - name: Create release
run: |
- stack --no-terminal setup
- stack --no-terminal update
- stack --no-terminal install --ghc-options='-j4 +RTS -A256m -RTS -split-sections'
-
- - name: Create artifacts
- run: |
- export VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $2;}')
- export ARTIFACTS=macos-release-candidate
- export RESOURCES=${ARTIFACTS}/Resources
- export ROOT=${ARTIFACTS}/pandoc
- export DEST=${ROOT}/usr/local
- export ME=$(whoami)
- export BASE=pandoc-$VERSION
- mkdir -p ${ARTIFACTS}
- mkdir -p ${RESOURCES}
- mkdir -p ${DEST}/bin
- mkdir -p ${DEST}/share/man/man1
- cp ~/.local/bin/pandoc ${DEST}/bin/
- strip ${DEST}/bin/pandoc
- cp man/pandoc.1 ${DEST}/share/man/man1/pandoc.1
- cp man/pandoc-server.1 ${DEST}/share/man/man1/pandoc-server.1
- cp man/pandoc-lua.1 ${DEST}/share/man/man1/pandoc-lua.1
- ~/.local/bin/pandoc -s COPYING.md -Vpagetitle=License -o ${RESOURCES}/license.html
- chown -R $ME:staff ${ROOT}
- sed -e "s/PANDOCVERSION/${VERSION}/" macos/distribution.xml.in > ${ARTIFACTS}/distribution.xml
- cp macos/Makefile ${ARTIFACTS}/
- echo ${VERSION} > ${ARTIFACTS}/version.txt
+ sh macos/make_macos_release.sh
- uses: actions/upload-artifact@v3
with:
diff --git a/macos/make_macos_release.sh b/macos/make_macos_release.sh
new file mode 100644
index 000000000..c08a737a5
--- /dev/null
+++ b/macos/make_macos_release.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $2;}')
+ARTIFACTS=macos-release-candidate
+RESOURCES=${ARTIFACTS}/Resources
+ROOT=${ARTIFACTS}/pandoc
+DEST=${ROOT}/usr/local
+ME=$(whoami)
+
+# Build the pandoc binary and put it in .
+cabal update
+cabal install pandoc-cli -fembed_data_files -fserver -flua --installdir=. \
+ --install-method=copy --overwrite-policy=always
+
+# Create directories
+mkdir -p ${ARTIFACTS}
+mkdir -p ${RESOURCES}
+mkdir -p ${DEST}/bin
+mkdir -p ${DEST}/share/man/man1
+
+# Copy binary and strip it
+cp ./pandoc ${DEST}/bin/
+strip ${DEST}/bin/pandoc
+
+# Copy man pages and license
+cp man/pandoc.1 ${DEST}/share/man/man1/pandoc.1
+cp man/pandoc-server.1 ${DEST}/share/man/man1/pandoc-server.1
+cp man/pandoc-lua.1 ${DEST}/share/man/man1/pandoc-lua.1
+./pandoc -s COPYING.md -Vpagetitle=License -o ${RESOURCES}/license.html
+
+# Prepare distribution directory; after downloading, run 'make' to notarize
+chown -R "$ME:staff" "${ROOT}"
+sed -e "s/PANDOCVERSION/${VERSION}/" macos/distribution.xml.in > ${ARTIFACTS}/distribution.xml
+cp macos/Makefile ${ARTIFACTS}/
+echo "${VERSION}" > "${ARTIFACTS}/version.txt"