aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 566879d10c5ef149f2d0da38b5eefdea51a4d93b (plain)
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
name: CI

env:
  BUILD_TYPE: Debug

on:
  push:
    branches:
      - master
      - dev
  pull_request:
    branches:
      - master
      - dev

jobs:
  build-linux:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Install dependencies
      run: |
        sudo apt-get update
        sudo apt-get -y install qt5-default libcurl4-openssl-dev libjson-c-dev cmake make wget

    - name: Configure CMake
      run: |
        cmake $GITHUB_WORKSPACE -B "build" \
          -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
          -DBUILD_CLI=ON -DBUILD_QT=ON

    - name: Build
      run: cmake --build build

  build-windows:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Install dependencies
      run: |
        sudo apt-key adv \
          --keyserver keyserver.ubuntu.com \
          --recv-keys 86B72ED9 && \
        sudo add-apt-repository \
          "deb [arch=amd64] https://pkg.mxe.cc/repos/apt `lsb_release -sc` main" && \
        sudo apt-get update
        sudo apt-get -y install mxe-i686-w64-mingw32.static-{cc,cmake,qt5,curl,json-c}

    - name: Configure CMake
      run: |
        PATH=/usr/lib/mxe/usr/bin:$PATH \
        i686-w64-mingw32.static-cmake $GITHUB_WORKSPACE -B "build" \
          -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
          -DBUILD_CLI=ON -DBUILD_QT=ON

    - name: Build
      run: |
        PATH=/usr/lib/mxe/usr/bin:$PATH \
        i686-w64-mingw32.static-cmake --build build

    - name: Upload Binaries
      if: ${{ !env.ACT }}
      uses: actions/upload-artifact@v2
      with:
        name: Windows Binaries
        path: |
          build/*.exe