-
Notifications
You must be signed in to change notification settings - Fork 313
208 lines (175 loc) · 7.52 KB
/
package.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Package
on: [push, pull_request]
jobs:
Build:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
architecture: [win32, win64]
library_linkage: [Dynamic, Static]
build_type: [Debug, Release]
env:
GENERATOR: Visual Studio 16 2019
VCPKG_DEFAULT_TRIPLET: ${{ matrix.architecture == 'win32' && 'x86' || 'x64' }}-${{ matrix.library_linkage == 'Dynamic' && 'windows' || 'windows-static-md' }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |-
echo "Using vcpkg triplet: $env:VCPKG_DEFAULT_TRIPLET"
C:\vcpkg\vcpkg install freetype[core]
- name: Configure CMake
run: >-
cmake -B Build
-G "$env:GENERATOR"
-A ${{ matrix.architecture == 'win32' && 'Win32' || 'x64' }}
-DRMLUI_WARNINGS_AS_ERRORS=ON
-DBUILD_SHARED_LIBS=${{ matrix.library_linkage == 'Dynamic' && 'ON' || 'OFF' }}
-DVCPKG_TARGET_TRIPLET="$env:VCPKG_DEFAULT_TRIPLET"
-DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/Install"
-DRMLUI_INSTALL_TARGETS_DIR=Bin-${{matrix.library_linkage}}/CMake
-DCMAKE_INSTALL_BINDIR=Bin-${{matrix.library_linkage}}/${{matrix.build_type}}
-DCMAKE_INSTALL_LIBDIR=Bin-${{matrix.library_linkage}}/${{matrix.build_type}}
-DCMAKE_INSTALL_INCLUDEDIR=Include
-DCMAKE_INSTALL_DATADIR="."
-DRMLUI_INSTALL_RUNTIME_DEPENDENCIES=OFF
-DRMLUI_INSTALL_LICENSES_AND_BUILD_INFO=ON
-DRMLUI_INSTALL_DEPENDENCIES_DIR="Dependencies/Bin-${{matrix.library_linkage}}"
-DRMLUI_ARCHITECTURE="${{ matrix.architecture }}"
-DRMLUI_COMMIT_DATE="$(git show $env:GITHUB_SHA --no-patch --format=%cd --date=iso)"
-DRMLUI_RUN_ID="$env:GITHUB_RUN_ID"
-DRMLUI_SHA="$env:GITHUB_SHA"
- name: Build
run: cmake --build Build --config ${{ matrix.build_type }}
- name: Install
run: cmake --install Build --config ${{ matrix.build_type }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.architecture }}-${{ matrix.library_linkage }}-${{ matrix.build_type }}
path: ${{github.workspace}}/Install/
if-no-files-found: error
Samples:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
architecture: [win32, win64]
env:
GENERATOR: Visual Studio 16 2019
VCPKG_DEFAULT_TRIPLET: ${{ matrix.architecture == 'win32' && 'x86' || 'x64' }}-windows${{ matrix.architecture == 'win64' && '-release' || '' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
name: Checkout dependency rlottie
with:
repository: 'Samsung/rlottie'
ref: 'd40008707addacb636ff435236d31c694ce2b6cf'
path: 'Dependencies/rlottie'
- name: Install Dependencies
run: |-
echo "Using vcpkg triplet: $env:VCPKG_DEFAULT_TRIPLET"
C:\vcpkg\vcpkg install glfw3[core] freetype[core] lua[core] lunasvg[core]
cd Dependencies\rlottie
cmake -B build -G "$env:GENERATOR" -A ${{ matrix.architecture == 'win32' && 'Win32' || 'x64' }} -DBUILD_SHARED_LIBS=ON -DLOTTIE_MODULE=OFF
cmake --build build --target rlottie --config Release -- "/clp:ErrorsOnly"
- name: Configure CMake
run: >-
cmake -B Build
-G "$env:GENERATOR"
-A ${{ matrix.architecture == 'win32' && 'Win32' || 'x64' }}
--preset samples-all
-DRMLUI_HARFBUZZ_SAMPLE=OFF
-DRMLUI_BACKEND=GLFW_GL3
-DBUILD_SHARED_LIBS=ON
-DRMLUI_WARNINGS_AS_ERRORS=ON
-DVCPKG_TARGET_TRIPLET="$env:VCPKG_DEFAULT_TRIPLET"
-DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/Install"
-DCMAKE_INSTALL_BINDIR="Samples"
-DCMAKE_INSTALL_DATADIR="."
-DRMLUI_INSTALL_LICENSES_AND_BUILD_INFO=ON
-DRMLUI_ARCHITECTURE="${{ matrix.architecture }}"
-DRMLUI_COMMIT_DATE="$(git show $env:GITHUB_SHA --no-patch --format=%cd --date=iso)"
-DRMLUI_RUN_ID="$env:GITHUB_RUN_ID"
-DRMLUI_SHA="$env:GITHUB_SHA"
- name: Build
run: cmake --build Build --config Release
- name: Copy runtime dependencies
run: cp Dependencies/rlottie/build/Release/rlottie.dll Build/Release/
- name: Install
run: cmake --install Build --config Release
- name: Copy readme
run: |-
cp readme.md Install/
cp changelog.md Install/
cp Samples/readme.md Install/Samples/
- name: Copy extra license files
run: |-
cp Dependencies/rlottie/licenses Install/Dependencies/rlottie -Recurse
cp Dependencies/rlottie/COPYING Install/Dependencies/rlottie
echo @'
The rlottie library includes source code licensed under Mozilla Public License Version 2.0.
The source for this code can be found in the rlottie library at the following URL:
https://github.com/Samsung/rlottie/blob/d40008707addacb636ff435236d31c694ce2b6cf/src/vector/vinterpolator.cpp
'@ > "Install/Dependencies/rlottie/vinterpolator.txt"
- uses: actions/upload-artifact@v4
with:
name: samples-${{ matrix.architecture }}
path: |
${{github.workspace}}/Install/
!${{github.workspace}}/Install/lib/
!${{github.workspace}}/Install/include/
if-no-files-found: error
Package:
needs: [Build, Samples]
runs-on: windows-2019
strategy:
fail-fast: true
matrix:
architecture: [win32, win64]
steps:
# Download artifacts in a well-defined order, with release binaries last.
- uses: actions/download-artifact@v4
with:
name: samples-${{ matrix.architecture }}
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.architecture }}-Dynamic-Debug
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.architecture }}-Static-Debug
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.architecture }}-Dynamic-Release
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.architecture }}-Static-Release
- uses: actions/upload-artifact@v4
with:
name: RmlUi-vs2019-${{ matrix.architecture }}
path: ./
Release:
needs: [Package]
runs-on: windows-2019
if: ${{ github.ref_type == 'tag' }}
permissions:
contents: write
steps:
- name: Download release artifacts
run: |
$release_artifacts = "RmlUi-vs2019-win64", "RmlUi-vs2019-win32", "samples-win64"
$headers = @{ "Authorization" = "token ${{ secrets.GITHUB_TOKEN }}" }
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/artifacts" -Headers $headers
foreach ($name in $release_artifacts) {
$artifact = $response.artifacts | Where-Object { $_.name -eq $name }
Invoke-WebRequest -Uri $artifact.archive_download_url -OutFile "$name.zip" -Headers $headers
}
- name: Release
uses: softprops/action-gh-release@v2
with:
name: RmlUi ${{ github.ref_name }}
files: "*.zip"
draft: true
fail_on_unmatched_files: true