Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -1
Expand Down Expand Up @@ -26,21 +25,24 @@ DerivePointerAlignment: false
FixNamespaceComments: false
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
- Regex: "^<[^.>]+>$"
Priority: 2
SortPriority: 0
SortPriority: 3
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: "^<.*"
- Regex: '^<.+\.(h|hpp)>$'
Priority: 2
SortPriority: 0
SortPriority: 4
CaseSensitive: false
- Regex: '^"[A-Z].*\/.+\.hpp"$'
Priority: 5
CaseSensitive: true
- Regex: "^.+/shared/.+"
Priority: 1
SortPriority: 2
CaseSensitive: true
- Regex: ".*"
Priority: 3
SortPriority: 0
Priority: 1
SortPriority: 1
CaseSensitive: false
IndentExternBlock: Indent
IndentRequiresClause: false
Expand All @@ -51,7 +53,7 @@ LineEnding: LF
NamespaceIndentation: All
PackConstructorInitializers: CurrentLine
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 0
PenaltyReturnTypeOnItsOwnLine: 50
QualifierAlignment: Right
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
Expand Down
5 changes: 5 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
Diagnostics:
UnusedIncludes: None
---
If:
PathMatch: ./extern/.*
Index:
Background: Skip
72 changes: 31 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,73 @@ name: Build

env:
module_id: metacore
qmodName: MetaCore

on:
workflow_dispatch:
push:
branches-ignore:
- 'version*'
- "version*"
paths-ignore:
- "**.md"
- "**.yml"
- ".clangd"
- ".clang-format"
- ".gitignore"
- "!.github/workflows/build.yml"
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
name: Checkout
with:
submodules: true
lfs: true

- uses: seanmiddleditch/gha-setup-ninja@v3

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt

- name: QPM Action
- name: Setup QPM
uses: Fernthedev/qpm-action@v1
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}

restore: true
resolve_ndk: true
cache: true

- name: List Post Restore
run: |
echo includes:
ls -la ${GITHUB_WORKSPACE}/extern/includes
echo libs:
ls -la ${GITHUB_WORKSPACE}/extern/libs

- name: Build & create qmod
- name: Build & Create QMOD
run: |
cd ${GITHUB_WORKSPACE}
qpm s qmod
qpm qmod zip

- name: Get Library Name
id: libname
- name: Get Output Names
id: names
run: |
cd ./build/
pattern="*.qmod"
files=( $pattern )
echo QMOD="${files[0]}" >> $GITHUB_OUTPUT
cd build
pattern="lib${module_id}*.so"
files=( $pattern )
echo NAME="${files[0]}" >> $GITHUB_OUTPUT

- name: Rename debug
run: |
mv ./build/debug/${{ steps.libname.outputs.NAME }} ./build/debug/debug_${{ steps.libname.outputs.NAME }}
echo LIB="${files[0]}" >> $GITHUB_OUTPUT

- name: Upload non-debug artifact
uses: actions/upload-artifact@v4
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: ${{ steps.libname.outputs.NAME }}
path: ./build/${{ steps.libname.outputs.NAME }}
name: ${{ steps.names.outputs.LIB }}
path: ./build/${{ steps.names.outputs.LIB }}
if-no-files-found: error

- name: Upload debug artifact
uses: actions/upload-artifact@v4
- name: Upload Debug Artifact
uses: actions/upload-artifact@v6
with:
name: debug_${{ steps.libname.outputs.NAME }}
path: ./build/debug/debug_${{ steps.libname.outputs.NAME }}
name: debug_${{ steps.names.outputs.LIB }}
path: ./build/debug/${{ steps.names.outputs.LIB }}
if-no-files-found: error

- name: Upload qmod artifact
uses: actions/upload-artifact@v4
- name: Upload QMOD Artifact
uses: actions/upload-artifact@v6
with:
name: ${{ env.qmodName }}.qmod
path: ./${{ env.qmodName }}.qmod
name: ${{ steps.names.outputs.QMOD }}
path: ./${{ steps.names.outputs.QMOD }}
if-no-files-found: error
69 changes: 27 additions & 42 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,33 @@ name: Publish

env:
module_id: metacore
qmodName: MetaCore
published_qmod: MetaCore

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (v will be added to the tag)'
release_ver:
description: "Version to release (v will be added to the tag)"
required: true
release_msg:
description: 'Message for release'
description: "Message for release"
required: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
name: Checkout
with:
submodules: true
lfs: true

- uses: seanmiddleditch/gha-setup-ninja@v3

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt

- name: QPM Action
- name: Setup QPM
uses: Fernthedev/qpm-action@v1
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}

restore: true
resolve_ndk: true
cache: true
Expand All @@ -49,41 +41,34 @@ jobs:
qpm_release_bin: true
qpm_debug_bin: false

qpm_qmod: ${{ env.qmodName }}.qmod
qpm_qmod: ${{ env.published_qmod }}.qmod

- name: List Post Restore
run: |
echo includes:
ls -la ${GITHUB_WORKSPACE}/extern/includes
echo libs:
ls -la ${GITHUB_WORKSPACE}/extern/libs

- name: Build & create qmod
- name: Build & Create QMOD
run: |
cd ${GITHUB_WORKSPACE}
qpm s qmod
qpm qmod zip

- name: Get Library Name
id: libname
- name: Get Output Names
id: names
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo NAME="${files[0]}" >> $GITHUB_OUTPUT
qmod_files=( "*.qmod" )
echo "QMOD=${qmod_files[0]}" >> ${GITHUB_OUTPUT}

- name: Rename debug
run: |
mv ./build/debug/${{ steps.libname.outputs.NAME }} ./build/debug/debug_${{ steps.libname.outputs.NAME }}
cd build

lib_files=( "lib${module_id}*.so" )
echo "LIB=${lib_files[0]}" >> ${GITHUB_OUTPUT}

cd debug
mv ${lib_files[0]} debug_${lib_files[0]}

- name: Upload to Release
id: upload_file_release
uses: softprops/action-gh-release@v0.1.12
- name: Create Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.event.inputs.release_msg }}
tag_name: "v${{ github.event.inputs.version }}"
tag_name: "v${{ github.event.inputs.release_ver }}"
files: |
./build/${{ steps.libname.outputs.NAME }}
./build/debug/debug_${{ steps.libname.outputs.NAME }}
./${{ env.qmodName }}.qmod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build/${{ steps.names.outputs.LIB }}
build/debug/debug_${{ steps.names.outputs.LIB }}
${{ steps.names.outputs.QMOD }}
27 changes: 15 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# VSCode
.cache/
.vscode/

# Jetbrains
# Jetbrains IDEs
.idea/

# NDK
ndkpath.txt
*.zip
*.txt
*.log

# QPM
# Files generated by QPM
extern/
ndkpath.txt
qpm_defines.cmake
extern.cmake
mod.json

# build
!CMakeLists.txt
# Build outputs and artifacts
build/
mod.json
mod.json.schema
*.zip
*.qmod

# Script outputs and artifacts
*.txt
*.log
*.html

# Exceptions
!CMakeLists.txt
Loading
Loading