forked from TES3MP/lua-cjson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
547 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: CJSON-Main | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
CJSON_MASTER: | ||
strategy: | ||
matrix: | ||
build_type: [Release, RelWithDebInfo, MinSizeRel, Debug] | ||
target_system: [ ubuntu-22.04, windows-2022 ] | ||
runs-on: ${{ matrix.target_system }} | ||
env: | ||
BUILD_EXT: ${{ matrix.target_system == 'windows-2022' && '.dll' || '.so' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Prime ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ matrix.target_system }}-${{ matrix.build_type }} | ||
max-size: 1000M | ||
|
||
- name: Cache LuaJIT | ||
id: cache-Lua | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ runner.os == 'Linux' && 'apt-cache' || 'LuaJIT' }} | ||
key: ${{ runner.os }}-Lua | ||
|
||
- name: Get Deps (LuaJIT) | ||
shell: bash | ||
if: steps.cache-Lua.outputs.cache-hit != 'true' | ||
run: | | ||
${{ runner.os == 'Linux' && 'sudo' || '' }} CI/get_luajit.${{runner.os}}.sh openmw-deps | ||
- name: Configure | ||
shell: bash | ||
run: | | ||
LUA_DIR=LuaJIT/ cmake . | ||
- name: Build | ||
run: | | ||
cmake --build . --config ${{ matrix.build_type }} | ||
- name: Prep Windows Release | ||
if: runner.os == 'Windows' | ||
run: | | ||
mv ${{ github.workspace }}/${{ matrix.build_type }}/cjson.dll ${{ github.workspace }}/cjson-${{ matrix.build_type }}.dll | ||
- name: Prep Linux Release | ||
if: runner.os != 'Windows' | ||
run: | | ||
mv ${{ github.workspace }}/cjson.so ${{ github.workspace }}/cjson-${{ matrix.build_type }}.so | ||
- name: Upload Release | ||
if: github.event_name != 'pull_request' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: Stable-CI | ||
files: ${{ github.workspace }}/cjson-${{ matrix.build_type }}${{ env.BUILD_EXT }} | ||
body: | | ||
CI Build for Dreamweave IO2 fork | ||
- name: Upload Artifact | ||
if: github.event_name == 'pull_request' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cjson-${{ matrix.build_type }}-${{matrix.target_system}} | ||
path: ${{ github.workspace }}/cjson-${{ matrix.build_type }}${{ env.BUILD_EXT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
print_help() { | ||
echo "usage: $0 [group]..." | ||
echo | ||
echo " available groups: "${!GROUPED_DEPS[@]}"" | ||
} | ||
|
||
declare -rA GROUPED_DEPS=( | ||
# Common dependencies for building OpenMW. | ||
[openmw-deps]=" | ||
libluajit-5.1-dev | ||
" | ||
) | ||
|
||
if [[ $# -eq 0 ]]; then | ||
>&2 print_help | ||
exit 1 | ||
fi | ||
|
||
deps=() | ||
for group in "$@"; do | ||
if [[ ! -v GROUPED_DEPS[$group] ]]; then | ||
>&2 echo "error: unknown group ${group}" | ||
exit 1 | ||
fi | ||
deps+=(${GROUPED_DEPS[$group]}) | ||
done | ||
|
||
export APT_CACHE_DIR="${PWD}/apt-cache" | ||
set -x | ||
mkdir -pv "$APT_CACHE_DIR" | ||
apt-get update -yq | ||
apt-get -q -o dir::cache::archives="$APT_CACHE_DIR" install -y --no-install-recommends "${deps[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
set -e | ||
|
||
download() { | ||
if [ $# -lt 3 ]; then | ||
echo "Invalid parameters to download." | ||
return 1 | ||
fi | ||
|
||
NAME=$1 | ||
shift | ||
|
||
echo "$NAME..." | ||
|
||
while [ $# -gt 1 ]; do | ||
URL=$1 | ||
FILE=$2 | ||
shift | ||
shift | ||
|
||
if ! [ -f $FILE ]; then | ||
printf " Downloading $FILE... " | ||
|
||
if [ -z $VERBOSE ]; then | ||
RET=0 | ||
curl --silent --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$? | ||
else | ||
RET=0 | ||
curl --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$? | ||
fi | ||
|
||
if [ $RET -ne 0 ]; then | ||
echo "Failed!" | ||
wrappedExit $RET | ||
else | ||
echo "Done." | ||
fi | ||
else | ||
echo " $FILE exists, skipping." | ||
fi | ||
done | ||
|
||
if [ $# -ne 0 ]; then | ||
echo "Missing parameter." | ||
fi | ||
} | ||
|
||
download "LuaJIT v2.1.0-beta3-452-g7a0cf5fd" \ | ||
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z" \ | ||
"LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z" | ||
|
||
echo "Extracting LuaJIT . . ." | ||
eval 7z x -y LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z -o./LuaJIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
include(LibFindMacros) | ||
|
||
libfind_pkg_detect(LuaJit luajit | ||
FIND_PATH luajit.h | ||
HINTS $ENV{LUA_DIR} | ||
PATH_SUFFIXES include include/luajit-2.1 | ||
FIND_LIBRARY luajit-5.1 luajit lua51 | ||
HINTS $ENV{LUA_DIR} | ||
PATH_SUFFIXES lib | ||
) | ||
|
||
|
||
libfind_process(LuaJit) | ||
|
||
set(LUA_LIBRARY ${LuaJit_LIBRARY}) | ||
set(LUA_INCLUDE_DIR ${LuaJit_INCLUDE_DIR}) |
Oops, something went wrong.