File: build-package-linux-macos.yml

package info (click to toggle)
gle-graphics 4.3.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,688 kB
  • sloc: cpp: 78,109; sh: 161; python: 150; makefile: 68; perl: 46; ansic: 1
file content (143 lines) | stat: -rw-r--r-- 4,920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#
# -- Build and Package for Linux and macOS
#    build, build manual, package, and upload
#    runs manually or on completion of Create Release workflow
#
name: Build & Package Linux and macOS
on:
  # run manually
  workflow_dispatch:
  # and run on completion of "Create Release" workflow
  # uploads artifacts to release
  repository_dispatch:
    types: [release]
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
        jobs=1
        case "$RUNNER_OS" in
          Linux)
            sudo apt-get update
            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 qt6-base-dev libpoppler-dev libpoppler-cpp-dev libpoppler-glib-dev \
                libpoppler-qt6-dev libglib2.0-dev extra-cmake-modules ghostscript dpkg-dev \
                texlive texlive-latex-extra texlive-science dvipng latexmk
            jobs=$(nproc)
            ;;
          macOS)
            # 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 zstd poppler glib extra-cmake-modules texlive
            echo "-D Qt6_DIR=$(brew --prefix qt)/lib/cmake/Qt6" >> configure.args
            jobs=$(sysctl -n hw.activecpu)
            ;;
        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"
        -DBUILD_TESTS=ON
        -DCMAKE_INSTALL_PREFIX=stage
        -DDEVELOPER_INSTALLATION=ON
        -DINSTALL_EXAMPLES=ON

    - name: Build GLE
      run: |
        case "$RUNNER_OS" in
          macOS)
            export DYLD_LIBRARY_PATH=/opt/homebrew/opt/ghostscript/lib:$DYLD_LIBRARY_PATH
          ;;
        esac
        xargs -t < build.args cmake --build build --config Release

    - name: Install GLE
      run: |
        cmake --install build --config Release

    - name: Build GLE Manual
      working-directory: ${{github.workspace}}/gle-manual
      run: |
        export PATH=${{github.workspace}}/stage/bin:$PATH; make -f Makefile.gcc

    #   not needed # must run again to install the manual
    # - name: Install Again for Manual
    #    cmake --install build --config Release

#    - name: Upload Artifacts - GLE Manual PDF
#      uses: actions/upload-artifact@v4.4.3
#      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 "DEB;ZIP;7Z;TGZ" -C Release -B ${{github.workspace}}/stage
            ;;
          macOS)
            # need this export for testgs to work - dont need if BUILD_TESTS=OFF
            export DYLD_LIBRARY_PATH=/opt/homebrew/opt/ghostscript/lib:$DYLD_LIBRARY_PATH
            cpack -G "DragNDrop;ZIP;7Z;TGZ" -C Release -B ${{github.workspace}}/stage
            ;;
        esac

    - name: Upload Artifacts - GLE Binary Distributables
      uses: actions/upload-artifact@v4.4.3
      with:
        name: GLE Binary Distributables ${{ runner.os }}
        path: ${{github.workspace}}/stage/gle-*.*
        if-no-files-found: warn
        retention-days: 0
        compression-level: 0

      # upload to release location if started with from release workflow
    - name: Upload Binary Distributables to Release Loaction
      if: ${{ github.event_name == 'repository_dispatch' }}
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file_glob: true
        file: ${{github.workspace}}/stage/gle-*.*
        tag: ${{ github.event.client_payload.tag }}