generated from aui-framework/example_assets_ui
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (131 loc) · 4.91 KB
/
build.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
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
144
145
146
147
148
149
150
151
152
name: Build
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches: [ master, develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GIT_SUBMODULE_STRATEGY: recursive
permissions:
contents: write
jobs:
build-desktop:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Cache AUI.BOOT deps
id: cache-aui-boot
uses: actions/cache@v3
env:
cache-name: cache-aui-boot
with:
path: $HOME/.aui
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install pkg-config libglew-dev zlib1g-dev libssl-dev libcrypt-dev libcurl4-openssl-dev libgtk-3-dev libfontconfig-dev ninja-build libpulse-dev gperf
- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
run: choco install gperf
- name: Install macos dependencies
if: matrix.os == 'macos-latest'
run: brew install ninja
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -G "${{ matrix.os=='windows-latest' && 'Visual Studio 17 2022' || 'Ninja' }}" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF ${{matrix.additional_cmake_flags}} -DAUI_IGNORE_OPENSSL=TRUE -DAUI_INSTALL_RUNTIME_DEPENDENCIES=TRUE -DTELEGRAM_API_ID=${{ secrets.TELEGRAM_API_ID }} -DTELEGRAM_API_HASH=${{ secrets.TELEGRAM_API_HASH }}
- name: Build project
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config RelWithDebInfo
- name: Build AUI tests
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config RelWithDebInfo --target Tests
- name: Run AUI tests
if: matrix.os == 'windows-latest'
working-directory: ${{github.workspace}}/build/bin/RelWithDebInfo/
run: ${{github.workspace}}/build/bin/RelWithDebInfo/Tests.exe
- name: Run AUI tests
if: matrix.os == 'ubuntu-latest'
working-directory: ${{github.workspace}}/build/bin
run: ${{github.workspace}}/build/bin/Tests
#
# - name: Pack
# working-directory: ${{github.workspace}}/build
# run: cpack . -CRelWithDebInfo
#
# - name: Upload
# uses: actions/upload-artifact@v4
# with:
# path: ${{github.workspace}}/build/*.tar.gz
# name: ${{ matrix.os }}
release:
runs-on: ubuntu-latest
permissions: write-all
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
name: "Create release page"
steps:
- name: Retrieve version
if: ${{ contains(github.ref, 'tags/v') }}
run: |
echo "TAG_NAME=${{ github.ref }} " >> $GITHUB_ENV
echo "RELEASE_NAME=${{ github.ref }} " >> $GITHUB_ENV
- name: Output version
id: version
run: |
echo "ref=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.RELEASE_NAME }}
draft: false
prerelease: true
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
ref: ${{ steps.version.outputs.ref }}
publish:
name: Publish ${{ matrix.os }}
runs-on: ubuntu-latest
needs: [build-desktop, release]
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: ./
name: ${{ matrix.os }}
- id: getfilename
run: echo "::set-output name=file::$(ls *.tar.gz)"
- name: Upload to Release
id: upload_to_release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ steps.getfilename.outputs.file }}
asset_name: ${{ steps.getfilename.outputs.file }}
asset_content_type: application/x-gtar