Skip to content

Commit ec6311e

Browse files
committed
Added support for building the windows libraries in an even more "vanilla" way
1 parent bf6bddc commit ec6311e

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.github/actions/rive-build/action.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
description: Push changes back to the same branch
3030
required: true
3131
default: "true"
32+
build_mode:
33+
description: Build mode (`patched` uses utils/build_rive_runtime.sh, `vanilla` uses build/build_rive.sh directly when supported)
34+
required: false
35+
default: "patched"
3236
with_vulkan:
3337
description: Pass --with-vulkan to the runtime build script
3438
required: false
@@ -84,6 +88,7 @@ runs:
8488
git status
8589
8690
- name: Build Rive runtime
91+
if: ${{ inputs.build_mode != 'vanilla' }}
8792
shell: bash
8893
env:
8994
INPUT_PLATFORM: ${{ inputs.platform }}
@@ -98,6 +103,82 @@ runs:
98103
echo "Running: ./utils/build_rive_runtime.sh ${args[*]}"
99104
bash utils/build_rive_runtime.sh "${args[@]}"
100105
106+
- name: Build Rive Runtime (vanilla)
107+
if: ${{ inputs.build_mode == 'vanilla' }}
108+
shell: bash
109+
env:
110+
INPUT_PLATFORM: ${{ inputs.platform }}
111+
INPUT_WITH_VULKAN: ${{ inputs.with_vulkan }}
112+
run: |
113+
set -euo pipefail
114+
115+
if [[ "$INPUT_PLATFORM" != "x86_64-win32" && "$INPUT_PLATFORM" != "x86-win32" ]]; then
116+
echo "error: build_mode=vanilla is currently only supported for win32 platforms" >&2
117+
exit 1
118+
fi
119+
120+
build_args=(release clean)
121+
if [ "$INPUT_WITH_VULKAN" = "true" ]; then
122+
build_args+=(--with_vulkan)
123+
fi
124+
build_args+=(
125+
--
126+
rive
127+
rive_pls_renderer
128+
rive_decoders
129+
rive_harfbuzz
130+
rive_sheenbidi
131+
rive_yoga
132+
miniaudio
133+
zlib
134+
libpng
135+
libjpeg
136+
libwebp
137+
)
138+
139+
echo "Running (in ${RIVE_ROOT}/renderer): ../build/build_rive.sh ${build_args[*]}"
140+
(
141+
cd "${RIVE_ROOT}/renderer"
142+
../build/build_rive.sh "${build_args[@]}"
143+
)
144+
145+
- name: Install Rive Runtime (vanilla)
146+
if: ${{ inputs.build_mode == 'vanilla' }}
147+
shell: bash
148+
env:
149+
INPUT_PLATFORM: ${{ inputs.platform }}
150+
run: |
151+
set -euo pipefail
152+
153+
repo_root="$(pwd -P)"
154+
prefix="${repo_root}/defold-rive"
155+
install_dir="${prefix}/lib/${INPUT_PLATFORM}"
156+
version_header="${prefix}/include/defold/rive_version.h"
157+
runtime_out_dir="${RIVE_ROOT}/renderer/out/release"
158+
159+
rm -rf "${prefix}/include/rive"
160+
mkdir -p "${install_dir}"
161+
rm -f "${install_dir}"/*.lib "${install_dir}"/*.a "${install_dir}"/*.dll
162+
163+
"${repo_root}/utils/buildscripts/build_headers.sh" --prefix "${prefix}" --root "${RIVE_ROOT}"
164+
"${repo_root}/utils/buildscripts/build_version_header.sh" "${version_header}" "${RIVE_ROOT}"
165+
166+
found_libs=0
167+
for ext in lib a; do
168+
for src in "${runtime_out_dir}"/*.${ext}; do
169+
if [[ ! -f "${src}" ]]; then
170+
continue
171+
fi
172+
cp -f "${src}" "${install_dir}/"
173+
found_libs=1
174+
done
175+
done
176+
177+
if [[ "${found_libs}" -eq 0 ]]; then
178+
echo "error: no .lib or .a files found in ${runtime_out_dir}" >&2
179+
exit 1
180+
fi
181+
101182
- name: Pack artifacts (optional)
102183
if: ${{ inputs.upload_artifact == 'true' }}
103184
shell: bash

.github/workflows/branch-artifacts.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ jobs:
351351
upload_artifact: ${{ github.event.inputs.upload_artifact }}
352352
commit_message: ${{ github.event.inputs.commit_message }}
353353
push_changes: ${{ github.event.inputs.push_changes }}
354+
build_mode: vanilla
354355
with_vulkan: true
355356

356357
build-plugin-macos:

0 commit comments

Comments
 (0)