Build & Package Linux and macOS #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# -- Build and Package for Linux and macOS | |
# build, build manual, package, and upload | |
# runs manually | |
# | |
name: Build & Package Linux and macOS | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build & Package on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
build_type: [Release] | |
c_compiler: [gcc] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout GLE | |
uses: actions/checkout@v4 | |
- name: Checkout GLE Library | |
uses: actions/checkout@v4 | |
with: | |
repository: "vlabella/gle-library" | |
path: gle-library | |
- name: Checkout GLE Manual | |
uses: actions/checkout@v4 | |
with: | |
repository: "vlabella/gle-manual" | |
path: gle-manual | |
- name: Install dependencies | |
run: | | |
set -x | |
touch configure.args | |
case $RUNNER_OS in | |
Linux) | |
sudo apt-get update | |
# Add libjbig-dev and libzstd-dev once GLE can find them without | |
# relying on nonexistent cmake config files. | |
# See https://github.com/vlabella/GLE/issues/16 | |
sudo apt-get install cmake freeglut3-dev libboost-dev \ | |
libcairo-dev libdeflate-dev libgs-dev \ | |
libjpeg-turbo8-dev liblzma-dev libpixman-1-dev \ | |
libpng-dev libtiff-dev libz-dev qtbase5-dev \ | |
libpoppler-dev libpoppler-cpp-dev libpoppler-glib-dev libpoppler-qt5-dev \ | |
libglib2.0-dev extra-cmake-modules \ | |
ghostscript texlive texlive-latex-extra texlive-science dvipng | |
jobs=$(nproc) | |
;; | |
macOS) | |
# Add jbigkit once GLE can find it without relying on nonexistent | |
# cmake config files. | |
# See https://github.com/vlabella/GLE/issues/16 | |
# liblzma and libz are already in macOS. | |
# cmake is preinstalled with Homebrew on GitHub Actions runners and | |
# trying to install it again produces an unintelligible warning. | |
brew install --quiet boost cairo ghostscript jpeg-turbo \ | |
libdeflate libpng libtiff pixman qt@5 zstd poppler glib extra-cmake-modules \ | |
ghostscript texlive | |
echo "-D Qt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5" >> configure.args | |
jobs=$(sysctl -n hw.activecpu) | |
;; | |
Windows) | |
# see build-windows.yml | |
;; | |
*) | |
jobs=1 | |
esac | |
echo "--parallel $jobs" >> build.args | |
- name: Configure cmake | |
run: > | |
xargs -t < configure.args cmake -S src -B build | |
-DCMAKE_BUILD_TYPE=Release | |
-DGLE_EXAMPLES_LIBRARY_PATH="${{github.workspace}}/gle-library" | |
-DGLE_USER_MANUAL_PATH="${{github.workspace}}/gle-manual" | |
- name: Build GLE | |
run: | | |
xargs -t < build.args cmake --build build --verbose | |
- name: Install GLE | |
run: | | |
DESTDIR=destroot cmake --install build | |
- name: Build GLE Manual | |
working-directory: ${{github.workspace}}/gle-manual | |
run: | | |
export PATH=${{github.workspace}}/destroot/usr/local/bin:$PATH; make -f Makefile.gcc | |
# - name: Upload Artifacts - GLE Manual PDF | |
# uses: actions/[email protected] | |
# with: | |
# name: GLE Manual PDF | |
# path: ${{github.workspace}}/gle-manual/gle-manual.pdf | |
# if-no-files-found: warn | |
# retention-days: 0 | |
# compression-level: 0 | |
- name: Package GLE | |
working-directory: ${{github.workspace}}/build | |
run: | | |
case $RUNNER_OS in | |
Linux) | |
cpack -G "ZIP;7Z" -C Release -B destroot/usr/local | |
;; | |
macOS) | |
cpack -G "DragNDrop;ZIP;7Z" -C Release -B destroot/usr/local | |
;; | |
*) | |
jobs=1 | |
esac | |
- name: Upload Artifacts - GLE Binary Distributables | |
uses: actions/[email protected] | |
with: | |
name: GLE Binary Distributables ${{ runner.os }} | |
path: ${{github.workspace}}/build/destroot/usr/local/gle-*.* | |
if-no-files-found: warn | |
retention-days: 0 | |
compression-level: 0 |