Skip to content

Commit

Permalink
add gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
PredatorCZ committed Aug 4, 2022
1 parent d0e404d commit 121e535
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 10 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: build

on: [push]

env:
BUILD_TYPE: Release

jobs:
build-linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: GCC 10 & Artifacts
CC: gcc-10
CXX: g++-10
artifacts: true
- name: Clang 10 & ODR
CC: clang-10
CXX: clang++-10
use-odr: true

env:
CC: ${{matrix.CC}}
CXX: ${{matrix.CXX}}
ODR_TEST: ${{matrix.odr-test == true}}

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Configure stuff
run: |
sudo apt install zstd
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DODR_TEST=$ODR_TEST -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/tmp ..
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . -j 6

- name: Install
if: ${{matrix.artifacts == true}}
working-directory: ${{github.workspace}}/build
run: |
cmake --build . --target install
cd ../tmp
install -D ../LICENSE share/doc/xenoblade-toolset/LICENSE.md
install -D ../toolset/README.md share/doc/xenoblade-toolset/README.md
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure

- name: Upload Artifacts
if: ${{matrix.artifacts == true}}
uses: actions/upload-artifact@v2
with:
name: XenobladeToolset-linux-amd64
path: ${{github.workspace}}/tmp
retention-days: 5

build-widle:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Configure stuff
run: |
choco install ninja
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{github.workspace}} ..
env:
CC: clang
CXX: clang++
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . -j 6

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure

- name: Install
run: |
cmake --build build --target install
copy LICENSE bin/LICENSE.md
copy toolset/README.md bin/README.md
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: XenobladeToolset-win64
path: ${{github.workspace}}/bin
retention-days: 5
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release

on:
release:
types: [published]

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

- name: Repack them
run: |
for file in *; do
if [ -d $file ]; then
pushd $file
7z a ../$file.7z .
popd
fi
done
- name: Release them
uses: softprops/action-gh-release@v1
with:
files: '*.7z'
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# XenoLib
[![Build Status](https://travis-ci.org/PredatorCZ/XenoLib.svg?branch=master)](https://travis-ci.org/PredatorCZ/XenoLib)

[![build](https://github.com/PredatorCZ/XenoLib/actions/workflows/cmake.yml/badge.svg)](https://github.com/PredatorCZ/XenoLib/actions/workflows/cmake.yml)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ca0b675a83e4448cb90ddb858607b9f5)](https://app.codacy.com/app/PredatorCZ/XenoLib?utm_source=github.com&utm_medium=referral&utm_content=PredatorCZ/XenoLib&utm_campaign=Badge_Grade_Dashboard)

XenoLib is independent serialize library for various formats used by Xenoblade Engine.\
Library is compilable under VS 2015, 2017, 2019 and GCC 7, 8.
Library is compilable under Clang 10, Windowns Clang 13.0.1 and G++10.

## Toolset

Toolset can be found in [Toolset folder](https://github.com/PredatorCZ/XenoLib/tree/master/toolset)

[Toolset releases](https://github.com/PredatorCZ/XenoLib/releases)

## Supported formats
* Loading for MXMD (camdo, wimdo) and their stream files.
* DRSM
* MTXT/LBIM conversion into dds/png format

* MXMD models (camdo, wimdo)
* DRSM/MXMD streams (casmt, wismt)
* MTXT/LBIM textures (witex, catex)
* XBC1 desompressor
* SAR archive
* SAR archives
* BDAT data files
* MTHS shaders
* BC (SKEL, ANIM)

## License

This library is available under GPL v3 license. (See LICENSE.md)

This library uses following libraries:

* libpng, more in libpng/LISENCE
* PreCore, Copyright (c) 2016-2019 Lukas Cone
* zlib, Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
* Decaf
* PreCore, Copyright (c) 2016-2022 Lukas Cone
* zlib, Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
75 changes: 75 additions & 0 deletions toolset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# XenobladeToolset

Xenoblade Toolset is a collection of conversion tools under XenoLib.

This toolset runs on Spike foundation.

Head to this **[Wiki](https://github.com/PredatorCZ/PreCore/wiki/Spike)** for more information on how to effectively use it.

## BDAT2JSON

### Module command: bdat_to_json

Converts BDAT data file or BDAT collection to JSON.

### Settings

- **extract**

**CLI Long:** ***--extract***\
**CLI Short:** ***-E***

**Default value:** true

Extract by data entry if possible.

## SHDExtract

### Module command: extract_shaders

Extract shaders from models, shader bundles or shaders. Converts them into GLSL code and/or shader assembly.

## SARCreate

### Module command: make_sar

Create SAR archives from files.

### Settings

- **extension**

**CLI Long:** ***--extension***\
**CLI Short:** ***-e***

**Default value:** sar

Set output file extension. (common: sar, chr, mot)

- **big-endian**

**CLI Long:** ***--big-endian***\
**CLI Short:** ***-e***

**Default value:** false

Output platform is big endian.

## SARExtract

### Module command: sar_extract

Exctract files from SAR archives.

## SMTExtract

### Module command: smt_extract

Extract and convert textures from stream files into DDS.

## TEX2DDS

### Module command: tex_to_dds

Convert textures or streamed textures into DDS format.

14 changes: 14 additions & 0 deletions toolset/doc_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

<?xml version="1.0"?>
<toolset_name>XenobladeToolset</toolset_name>
<toolset_description>Xenoblade Toolset is a collection of conversion tools under XenoLib.

This toolset runs on Spike foundation.

Head to this **[Wiki](https://github.com/PredatorCZ/PreCore/wiki/Spike)** for more information on how to effectively use it.</toolset_description>
<smt_extract name="SMTExtract">Extract and convert textures from stream files into DDS.</smt_extract>
<tex_to_dds name="TEX2DDS">Convert textures or streamed textures into DDS format.</tex_to_dds>
<sar_extract name="SARExtract">Exctract files from SAR archives.</sar_extract>
<make_sar>Create SAR archives from files.</make_sar>
<extract_shaders name="SHDExtract">Extract shaders from models, shader bundles or shaders. Converts them into GLSL code and/or shader assembly.</extract_shaders>
<bdat_to_json>Converts BDAT data file or BDAT collection to JSON.</bdat_to_json>

0 comments on commit 121e535

Please sign in to comment.