-
Notifications
You must be signed in to change notification settings - Fork 95
103 lines (98 loc) · 3.39 KB
/
main.yml
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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
SUPPORT_HEIC: ${{ github.event_name == 'pull_request' }}
jobs:
build_linux:
name: Build on linux systems
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
env:
build_dir: "build"
config: "Release"
CC: gcc-10
CXX: g++-10
APPIMAGE_EXTRACT_AND_RUN: 1# https://github.com/AppImage/AppImageKit/wiki/FUSE#docker
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake gcc-10 g++-10 libglu1-mesa-dev xorg-dev zenity zlib1g-dev
- uses: actions/checkout@v1
with:
submodules: recursive
- name: CMake
run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }}
- name: Build
working-directory: ${{ env.build_dir }}
run: cmake --build . --target all --verbose -j
- name: Package
working-directory: ${{ env.build_dir }}
run: cmake --build . --target package --verbose
- name: Upload AppImage
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: Linux executable
path: ${{ env.build_dir }}/tev.appimage
build_macos:
name: Build on macOS
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- arch: x86_64
# The macos-13 runner uses Intel machines, see
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
os: macos-13
- arch: arm64
# The latest macos runners use arm machines. Picking runners like this avoids fringe issues with cross-compilation.
os: macos-latest
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Build
run: scripts/create-dmg.sh -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} -DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}"
- name: Upload arm64 .dmg
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: macOS installer (${{ matrix.arch }})
path: tev.dmg
build_windows:
name: Build on Windows
runs-on: windows-2022
env:
build_dir: "build"
config: "Release"
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: CMake
run: cmake . -B ${{ env.build_dir }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }}
- name: Build
working-directory: ${{ env.build_dir }}
run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose
- name: Create installer
working-directory: ${{ env.build_dir }}
run: cpack
- name: Upload executable
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: Windows executable
path: ${{ env.build_dir }}/${{ env.config }}/tev.exe
- name: Upload installer
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: Windows installer
path: ${{ env.build_dir }}/tev-installer.msi