Skip to content

Add packaging GitHub workflow (WIP) #2

Add packaging GitHub workflow (WIP)

Add packaging GitHub workflow (WIP) #2

Workflow file for this run

name: Package
on: push
jobs:
Build:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
library_linkage: [Dynamic, Static]
architecture: [win32, win64]
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@v3
- name: Install Dependencies
run: |-
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"
-DCMAKE_INSTALL_BINDIR=Bin-${{matrix.library_linkage}}/${{matrix.build_type}}
-DCMAKE_INSTALL_LIBDIR=Bin-${{matrix.library_linkage}}/${{matrix.build_type}}
-DCMAKE_INSTALL_INCLUDEDIR=Include
-DRMLUI_INSTALL_TARGETS_DIR=Bin-${{matrix.library_linkage}}/CMake
- 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.build_type }}-${{ matrix.library_linkage }}
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-release
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |-
C:\vcpkg\vcpkg install freetype[core] glfw3[core] lua[core] lunasvg[core]
cd Dependencies
git clone --depth 1 --branch v0.2 https://github.com/Samsung/rlottie.git
cd 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_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"
- name: Build
working-directory: ${{github.workspace}}/Build
run: cmake --build . --config Release
- name: Install
working-directory: ${{github.workspace}}/Build
run: cmake --install . --config Release
- name: Copy licenses
run: |-
cp Include/RmlUi/Core/Containers/LICENSE.txt Install/LICENSE.Core.ThirdParty.txt
cp Source/Debugger/LICENSE.txt Install/LICENSE.Debugger.ThirdParty.txt
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/29b391b95913877b7234543da8b4a9ec6d8175d0/src/vector/vinterpolator.cpp
'@ > "Install/share/LICENSE.Lottie.ThirdParty.txt"
- name: Write readme
run: |-
$rmlui_version=""
if ($env:GITHUB_REF -like "refs/tags/*") {
$rmlui_version=" $env:GITHUB_REF" -replace "refs/tags/", ""
}
$date=git show $env:GITHUB_SHA --no-patch --format=%cd --date=iso
echo @"
RmlUi$rmlui_version library and sample binaries for ${{ matrix.architecture }}.
https://github.com/mikke89/RmlUi
Built using $env:GENERATOR on $date (run $env:GITHUB_RUN_ID).
Commit id: $env:GITHUB_SHA
"@ > "Install/Build.txt"
- uses: actions/upload-artifact@v4
with:
name: samples-${{ matrix.architecture }}
path: ${{github.workspace}}/Install/
if-no-files-found: error
Package:
needs: [Build, Samples]
runs-on: windows-2019
strategy:
fail-fast: true
matrix:
architecture: [win32, win64]
steps:
- uses: actions/download-artifact@v4
with:
pattern: build-${{ matrix.architecture }}-*
merge-multiple: false
- uses: actions/download-artifact@v4
with:
name: samples-${{ matrix.architecture }}
path: Samples
- name: List artifact contents
run: |
Get-ChildItem -Recurse | ForEach-Object { $_.FullName }
- name: Zip artifacts
run: |
7z a RmlUi-vs2019-${{ matrix.architecture }}.zip ./
- name: Artifact SHA256 sum
run: |
cmake -E sha256sum RmlUi-vs2019-${{ matrix.architecture }}.zip
- uses: actions/upload-artifact@v4
with:
name: RmlUi-vs2019-${{ matrix.architecture }}
path: RmlUi-vs2019-${{ matrix.architecture }}.zip