This repository was archived by the owner on Jul 23, 2026. It is now read-only.
Repository navigation
123 lines (108 loc) · 3.2 KB
/
Copy pathbuild.yml
File metadata and controls
123 lines (108 loc) · 3.2 KB
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
# build.yml
name: Build
on:
push:
paths:
- '**/*.cpp'
- '**/*.hpp'
- '**/*.h'
- '.github/workflows/build.yml'
- '**/CMakeLists.txt'
pull_request:
paths:
- '**/*.cpp'
- '**/*.hpp'
- '**/*.h'
- '.github/workflows/build.yml'
- '**/CMakeLists.txt'
release:
types: [created]
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Read VERSION
id: extract
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
build:
needs: version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
arch: x64
cmake_arch: x64
- os: windows-2025
arch: x86
cmake_arch: Win32
- os: ubuntu-latest
arch: x64
cmake_arch: native
name: Build ${{ matrix.arch }} on ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
submodules: recursive
- name: Set up CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: latest
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential libx11-dev libxcursor-dev libxi-dev \
libxrandr-dev libxext-dev libdrm-dev libgbm-dev \
libwayland-dev libegl1-mesa-dev libfreetype6-dev libharfbuzz-dev
- name: Configure
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
cmake -S . -B build_${{ matrix.arch }} -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.cmake_arch }}
else
cmake -S . -B build_${{ matrix.arch }} -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
fi
shell: bash
- name: Build
run: cmake --build build_${{ matrix.arch }} --config Release
- name: Install
run: cmake --install build_${{ matrix.arch }} --config Release
- name: Organize output
shell: bash
run: |
mkdir -p dist/examples dist/tools
cp VERSION dist/
if [[ -d examples/bin ]]; then
cp -r examples/bin/. dist/examples/
else
echo "warning: examples/bin does not exist."
fi
if [[ "$RUNNER_OS" == "Windows" && -d tools ]]; then
cp -r tools/*.exe dist/tools/ || echo "tools not found"
fi
- name: Upload dist directory
uses: actions/upload-artifact@v4
with:
name: PopLib-${{ needs.version.outputs.version }}-${{ matrix.os }}-${{ matrix.arch }}
path: dist/
release:
needs: [version, build]
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: artifacts/**/*