|
| 1 | +# Github action script for building linux executables of this project |
| 2 | +# Copyright (C) 2022 VadVergasov as part of Plnguins |
| 3 | + |
| 4 | +# This program is free software: you can redistribute it and/or modify |
| 5 | +# it under the terms of the GNU Affero General Public License as published |
| 6 | +# by the Free Software Foundation, either version 3 of the License, or |
| 7 | +# (at your option) any later version. |
| 8 | + |
| 9 | +# This program is distributed in the hope that it will be useful, |
| 10 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +# GNU Affero General Public License for more details. |
| 13 | + |
| 14 | +# You should have received a copy of the GNU Affero General Public License |
| 15 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | +name: MacOS build |
| 17 | + |
| 18 | +on: |
| 19 | + push: |
| 20 | + paths-ignore: |
| 21 | + - "**.md" |
| 22 | + - "LICENSE" |
| 23 | + - "README.md" |
| 24 | + - ".github/**" |
| 25 | + - "!.github/workflows/macos-build.yml" |
| 26 | + |
| 27 | +env: |
| 28 | + BUILD_TYPE: Release |
| 29 | + QT_VERSION: "6.2.4" |
| 30 | + BOOST_VERSION: "1.79.0" |
| 31 | + QT_DIR: ${{ github.workspace }} |
| 32 | + BOOST_DIR: ${{ github.workspace }} |
| 33 | + |
| 34 | +jobs: |
| 35 | + linux: |
| 36 | + name: MacOS |
| 37 | + runs-on: macos-latest |
| 38 | + strategy: |
| 39 | + matrix: |
| 40 | + arch: [x64] |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v3 |
| 43 | + name: Clone |
| 44 | + with: |
| 45 | + submodules: recursive |
| 46 | + - name: Cache Qt |
| 47 | + id: cache-qt |
| 48 | + uses: actions/cache@v3 |
| 49 | + with: |
| 50 | + path: ${{ env.QT_DIR }}/Qt |
| 51 | + key: ${{ runner.os }}-Qt-${{ env.QT_VERSION }}-${{ env.QT_DIR }} |
| 52 | + - name: Cache Boost |
| 53 | + id: cache-boost |
| 54 | + uses: actions/cache@v3 |
| 55 | + with: |
| 56 | + path: ${{ env.BOOST_DIR }}/boost/boost |
| 57 | + key: ${{ runner.os }}-Boost-${{ env.BOOST_VERSION }}-${{ env.BOOST_DIR }} |
| 58 | + - name: Install Qt |
| 59 | + uses: jurplel/install-qt-action@v2 |
| 60 | + with: |
| 61 | + cached: ${{ steps.cache-qt.outputs.cache-hit }} |
| 62 | + version: ${{ env.QT_VERSION }} |
| 63 | + dir: ${{ env.QT_DIR }} |
| 64 | + host: "mac" |
| 65 | + target: "desktop" |
| 66 | + setup-python: "false" |
| 67 | + - name: Install boost |
| 68 | + id: install-boost |
| 69 | + if: steps.cache-boost.outputs.cache-hit != 'true' |
| 70 | + uses: MarkusJx/install-boost@v2.3.0 |
| 71 | + with: |
| 72 | + boost_version: ${{ env.BOOST_VERSION }} |
| 73 | + platform_version: 11 |
| 74 | + toolset: clang |
| 75 | + boost_install_dir: ${{ env.BOOST_DIR }} |
| 76 | + - name: Configure CMake |
| 77 | + run: | |
| 78 | + cmake -B ${{ github.workspace }}/build \ |
| 79 | + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ |
| 80 | + -DBoost_INCLUDE_DIR=${{ env.BOOST_DIR }}/boost/boost/include \ |
| 81 | + -DBoost_LIBRARY_DIRS=${{ env.BOOST_DIR }}/boost/boost/lib |
| 82 | + - name: Build |
| 83 | + run: cmake --build ${{ github.workspace }}/build --parallel --config ${{ env.BUILD_TYPE }} |
| 84 | + - uses: actions/upload-artifact@v3 |
| 85 | + name: Upload builded app |
| 86 | + with: |
| 87 | + name: CRM |
| 88 | + path: ${{ github.workspace }}/build/bin |
0 commit comments