Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
PredatorCZ committed Jan 14, 2025
1 parent 38c84cf commit fc4fd97
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 90 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand Down Expand Up @@ -104,14 +104,14 @@ jobs:
tar -cvaf ${{github.workspace}}/HavokPy-v${{env.PY_VERSION}}-linux-amd64.tar.xz .
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: HavokToolset-linux-amd64
path: ${{github.workspace}}/HavokToolset-v${{env.SK_VERSION}}-linux-amd64.tar.xz
retention-days: 5

- name: Upload Python Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: HavokPy-linux-amd64
path: ${{github.workspace}}/HavokPy-v${{env.PY_VERSION}}-linux-amd64.tar.xz
Expand All @@ -120,15 +120,14 @@ jobs:
build-widle:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Configure stuff
# REMOVEME: llvm install when v16 is deployed
run: |
choco install ninja llvm
choco install ninja
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{github.workspace}} ..
Expand All @@ -148,7 +147,7 @@ jobs:
copy toolset/README.md bin/README.md
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: HavokToolset-v${{env.SK_VERSION}}-win64
path: ${{github.workspace}}/bin
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ on:
branches:
- master

env:
SK_VERSION: nover

jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: cmake.yml
branch: ${{ github.event.release.target_commitish }}
workflow_conclusion: success

- name: Import signature key
uses: crazy-max/ghaction-import-gpg@v5
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GHA_GPG_KEY }}
passphrase: ${{ secrets.GHA_GPG_PWD }}
Expand All @@ -43,26 +46,25 @@ jobs:
fi
done
- name: Clear nightly assets
uses: andreaswilli/delete-release-assets-action@v3.0.0
- uses: actions/checkout@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
deleteOnlyFromDrafts: false
path: repo

- name: Delete release
working-directory: repo
run: gh release delete nightly --cleanup-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Wait a sec
run: sleep 2

- name: Release them
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
*.xz
*.7z
*.sig
tag_name: nightly

- uses: actions/checkout@v3
- name: Redirect nightly tag
run: |
git config --global user.email "nightly-bot"
git config --global user.name "nightly-bot"
git tag nightly --message "" --force
git push origin nightly --force
name: HavokToolset ${{env.SK_VERSION}} (nightly)
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.13)

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
message(FATAL_ERROR "X86 architecture is not supported!")
Expand All @@ -10,7 +10,6 @@ find_package(Python3 COMPONENTS Development Interpreter)

# ~~~
# Valid targets:
# - havok-static: static library target (HK_STATIC_LIB == ON, force enables havok-objects target)
# - havok-objects: static objects target (enabled by default, set NO_OBJECTS to disable all)
# - havok: shared library target (BUILD_SHARED_LIBS == ON)
# ~~~
Expand All @@ -24,9 +23,6 @@ if(NOT Python3_FOUND AND PYTHON_MODULE)
endif()

option(OBJECTS_PID "Imply PID for all objects." ${PYTHON_MODULE})
option(HK_STATIC_LIB "Builds havok-static target." OFF)

set(BUILD_SHARED_LIBS ${TOOLSET})

option(NO_OBJECTS "" OFF)
option(CLI "" ${TOOLSET})
Expand All @@ -35,6 +31,10 @@ option(GLTF "" ${TOOLSET})
set(CMAKE_CXX_STANDARD 20)
add_compile_options(-Wall -Wextra)

if(TOOLSET)
set(EXPOSE_SYMBOLS spike;gltf;havok;pugixml)
endif()

set(TPD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party)
add_subdirectory(${TPD_PATH}/spike)
include(targetex)
Expand Down
58 changes: 22 additions & 36 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
file(GLOB_RECURSE CORE_SOURCE_FILES "*.cpp")

if((NOT NO_OBJECTS) OR HK_STATIC_LIB)
add_library(havok-interface INTERFACE)
target_include_directories(havok-interface INTERFACE ../include)
target_link_libraries(havok-interface INTERFACE spike-interface)

if(NOT NO_OBJECTS)
build_target(
NAME
havok-objects
TYPE
OBJECT
SOURCES
${CORE_SOURCE_FILES}
PROPERTIES
POSITION_INDEPENDENT_CODE ${OBJECTS_PID}
INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}
LINKS
spike-objects
havok-interface
NO_VERINFO
NO_PROJECT_H)

set_target_properties(havok-objects PROPERTIES POSITION_INDEPENDENT_CODE
${OBJECTS_PID})
target_compile_options(havok-objects PRIVATE -fvisibility=hidden)

target_include_directories(
havok-objects
PUBLIC ../include
PRIVATE .)
endif()

if(HK_STATIC_LIB)
build_target(
NAME
havok-static
PROPERTIES
OUTPUT_NAME
havok
TYPE
STATIC
LINKS
havok-objects
NO_VERINFO
NO_PROJECT_H)
target_compile_options(havok-objects PRIVATE -fvisibility=hidden)
target_expose_defs(havok HK_EXPORT HK_IMPORT)
endif()

if(BUILD_SHARED_LIBS)
Expand All @@ -46,33 +34,31 @@ if(BUILD_SHARED_LIBS)
SHARED
SOURCES
${CORE_SOURCE_FILES}
INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}
LINKS
spike
pugixml
havok-interface
START_YEAR
2017
AUTHOR
"Lukas Cone"
NO_PROJECT_H)

target_compile_definitions(havok PRIVATE HK_EXPORT)

if(WIN32 OR MINGW)
set_target_properties(havok PROPERTIES SUFFIX ${PROJECT_VERSION_MAJOR}.dll
PREFIX "")
else()
set_target_properties(havok PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR})
endif()

target_include_directories(
havok
PUBLIC ../include
PRIVATE .)

target_compile_definitions(
havok
PRIVATE HK_EXPORT REF_EXPORT
INTERFACE HK_IMPORT)
target_compile_definitions(havok INTERFACE HK_IMPORT)

install(
TARGETS havok
LIBRARY NAMELINK_SKIP DESTINATION $<IF:$<BOOL:${MINGW}>,bin,lib>
RUNTIME DESTINATION bin)
TARGETS havok
LIBRARY NAMELINK_SKIP DESTINATION $<IF:$<BOOL:${MINGW}>,bin,lib>
RUNTIME DESTINATION bin)
endif()
1 change: 1 addition & 0 deletions toolset/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project(HavokToolset)
set_target_properties(spike_cli PROPERTIES OUTPUT_NAME havok_toolset)
target_link_libraries(spike_cli havok-objects)

include(version)
toolset_version()
Expand Down
62 changes: 43 additions & 19 deletions toolset/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# HavokToolset

Havok Toolset is a collection of conversion tools under HavokLib.
<h1 align="center">Havok Toolset</h1>

This toolset runs on Spike foundation.
<p align="center">
Havok Toolset is a collection of conversion tools under HavokLib.
</p>

Head to this **[Wiki](https://github.com/PredatorCZ/Spike/wiki/Spike)** for more information on how to effectively use it.
<p align="center">
This toolset runs on Spike foundation.
</p>

## Release authenticity
<p align="center">
Head to this
<b><a href="https://github.com/PredatorCZ/Spike/wiki/Spike">Wiki</a></b>
for more information on how to effectively use it.
</p>

Every release asset will contain corresponding `.sig` file, together with [Sign Key](sign_key.asc) can be used to verify asset via gpg.

Simple usage:

```bash
gpg --import sign_key.asc # Required only once
gpg --verify <asset_name>.sig
```
<p align="center">
<b><a href="https://github.com/PredatorCZ/RevilLib/releases">Latest Release</a></b>
</p><h2>Module list</h2>
<ul>
<li><a href="#Havok2GLTF">Havok2GLTF</a></li>
</ul>

## Havok2GLTF

Expand All @@ -25,6 +30,8 @@ Converts Havok data into GLTF.

Supports animation and skeleton data.

### Input file patterns: `.hkx$`, `.hka$` or user specified

### Settings

- **extension-patterns**
Expand Down Expand Up @@ -63,16 +70,25 @@ Supports animation and skeleton data.

**Default value:** NONE

**Valid values:**
**Valid values:**

- NONE: Ignore scale tracks.

- INDEPENDENT: Input scale tracks does not affect child nodes positions.
They also doesn't introduce shearing like in MATRICIAL case.
They however require modified skeleton. See SkeletonGeneration.
- INDEPENDENT:
Input scale tracks does not affect child nodes positions.
They also doesn't introduce shearing like in MATRICIAL case.

Select desired processing mode for node scale tracks.

- **filename-anims**

**CLI Long:** ***--filename-anims***\
**CLI Short:** ***-f***

**Default value:** false

Use filename for unnamed animations instead of Motion[]

- **skeleton**

- **skeleton-path**
Expand All @@ -89,7 +105,7 @@ They however require modified skeleton. See SkeletonGeneration.

**Default value:** DEFAULT

**Valid values:**
**Valid values:**

- DEFAULT: Do not modify skeleton in any way.

Expand All @@ -115,6 +131,15 @@ They however require modified skeleton. See SkeletonGeneration.

Create visualization mesh for skeletons. (Enforces armature object for Blender)

- **create-root-node**

**CLI Long:** ***--create-root-node***\
**CLI Short:** ***-N***

**Default value:** false

Force create root node named after skeleton. (Separates root motion)

- **scene**

- **units**
Expand Down Expand Up @@ -167,4 +192,3 @@ They however require modified skeleton. See SkeletonGeneration.
**Default value:** true

Input scene uses right handed coordiante system. (Finicky with root motion rotations)

Loading

0 comments on commit fc4fd97

Please sign in to comment.