-
Notifications
You must be signed in to change notification settings - Fork 4
executable file
·136 lines (114 loc) · 4.21 KB
/
build.yaml
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
name: C++ CI
on: [push]
jobs:
build:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-24.04
compiler: gcc
gcc: 13.1
triplet: x64-linux
steps:
- uses: actions/checkout@v3
- name: add ssh private keys for submodule repositories
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.SSH_KEY_SUBMODULE_AI_OMNISCOPE_V2 }}
- name: checkout submodules
run: git submodule update --init --recursive
- name: setup
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
- name: install deps
uses: awalsh128/cache-apt-pkgs-action@latest
if: ${{ !contains(matrix.os, 'windows' ) }}
with:
packages: libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config
version: 1.0
- name: setup prerequisites
if: ${{ !contains(matrix.os, 'windows' ) }}
shell: bash
run: |
sudo apt update
sudo apt install autoconf libudev-dev
# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly.
# As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1
- name: CMake configure
if: ${{ !contains(matrix.os, 'windows' ) }}
run: cmake -S . -B ./build -DCMAKE_BUILD_TYPE="Release"
- name: build
if: ${{ !contains(matrix.os, 'windows' ) }}
run: cmake --build ./build
- name: CMake configure
if: ${{ contains(matrix.os, 'windows' ) }}
run: cmake -S . -B ./build -DVCPKG_TARGET_TRIPLET="x64-windows-static"
- name: build
if: ${{ contains(matrix.os, 'windows' ) }}
run: cmake --build ./build --config Release
- name: upload executable (Linux)
uses: actions/upload-artifact@v4
if: ${{ !contains(matrix.os, 'windows' ) }}
with:
name: ${{ github.event.repository.name }}-linux
path: |
build/OmniView
config/config.json
languages/Deutsch.json
- name: upload executable (Windows)
uses: actions/upload-artifact@v4
if: ${{ contains(matrix.os, 'windows' ) }}
with:
name: ${{ github.event.repository.name }}-windows
path: |
build/Release/OmniView.exe
config/config.json
languages/Deutsch.json
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: download files
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: display name of downloaded-artifacts
run: ls -R
- name: zip release files (Ubuntu)
uses: montudor/action-zip@v1
with:
args: zip -qq -r ${{github.event.repository.name}}-${{ github.ref_name }}-ubuntu.zip
build/OmniView
config/config.json
languages/Deutsch.json
- name: zip release files (Windows)
uses: montudor/action-zip@v1
with:
args: zip -qq -r ${{github.event.repository.name}}-${{ github.ref_name }}-windows.zip
build/Release/OmniView.exe
config/config.json
languages/Deutsch.json
- name: create release
uses: ncipollo/release-action@v1
with:
artifacts: |
build/Release/OmniView.exe
config/config.json
languages/Deutsch.json
${{github.event.repository.name}}-${{ github.ref_name }}-ubuntu.zip
${{github.event.repository.name}}-${{ github.ref_name }}-windows.zip