Skip to content

Commit

Permalink
Merge pull request #31 from EnderdracheLP/dev/1.37
Browse files Browse the repository at this point in the history
Update to 1.37.0
  • Loading branch information
michael-r-elp authored Aug 30, 2024
2 parents 9932447 + 2578e54 commit ffac0ba
Show file tree
Hide file tree
Showing 176 changed files with 7,665 additions and 5,555 deletions.
81 changes: 32 additions & 49 deletions .github/workflows/buildMod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,32 @@ on:

env:
module_id: MultiplayerCore
version: 0.1.0-Dev.${{ github.run_number }}
# ndkname: android-ndk-r24

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout
with:
submodules: true
lfs: true

# - name: Extract branch name
# shell: bash
# run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
# id: extract_branch

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

# - name: Install Powershell
# run: sudo apt-get install -y powershell

# - name: Cache Android NDK
# id: cache-ndk
# uses: actions/cache@v2
# env:
# cache-name: cache-ndk
# with:
# path: ndk
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }}
# restore-keys: |
# ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }}

# - name: Install Android NDK
# if: steps.cache-ndk.outputs.cache-hit != 'true'
# run: |
# wget -q -O ndk.zip https://dl.google.com/android/repository/${ndkname}-linux-x86_64.zip
# unzip -q ndk.zip
# mv ${ndkname} ndk

# - name: Create ndkpath.txt
# run: |
# cd ndk
# pwd > ${GITHUB_WORKSPACE}/ndkpath.txt
- name: Get Version
shell: pwsh
run: |
$branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "version=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Split('-')[0])-$($branchMain).${{ github.run_number }}+$($branchSub)ra${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: seanmiddleditch/gha-setup-ninja@v5

- name: Create ndkpath.txt
run: |
Expand All @@ -69,30 +54,31 @@ jobs:
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: cargo-build.yml
name: linux-qpm-rust
name: linux-qpm
path: QPM
repo: RedBrumbler/QuestPackageManager-Rust
repo: QuestPackageManager/QPM.CLI

- name: QPM Collapse
run: |
chmod +x ./QPM/qpm-rust
./QPM/qpm-rust collapse
chmod +x ./QPM/qpm
./QPM/qpm collapse
- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v3
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: /home/runner/.local/share/QPM-Rust/cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.json', '.github/BuildQSounds.yml') }}
path: /home/runner/.local/share/QPM-RS/cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-${{ env.cache-name }}
- name: QPM Restore
- name: QPM Set Version & Restore
run: |
./QPM/qpm-rust restore
./QPM/qpm package edit --version ${{ env.version }}
./QPM/qpm restore
- name: Check dependency Folders
run: |
Expand All @@ -102,16 +88,14 @@ jobs:
echo "Checking libs"
ls -lh ${GITHUB_WORKSPACE}/extern/libs
echo ""
echo "Checking QPM-Rust/cache Folder"
ls -lh $HOME/.local/share/QPM-Rust/cache
echo "Checking QPM/cache Folder"
ls -lh $HOME/.local/share/QPM-RS/cache
echo ""
- name: Build
run: |
cd ${GITHUB_WORKSPACE}
./QPM/qpm-rust package edit --version ${{ env.version }}
./QPM/qpm-rust qmod build
pwsh -Command ./build.ps1 --actions
pwsh -Command ./build.ps1 -actions
- name: Get Library Name
id: libname
Expand All @@ -120,32 +104,31 @@ jobs:
pattern="lib${module_id}*.so"
files=( $pattern )
echo "NAME=${files[0]}" >> $GITHUB_OUTPUT
# echo ::set-output name=NAME::"${files[0]}"
- name: Package QMOD
run: |
cd ${GITHUB_WORKSPACE}
pwsh -Command ./buildQMOD.ps1 -package
./QPM/qpm qmod zip -i ./build/ -i ./extern/libs/ ${module_id}_${version}.qmod
- name: Upload non-debug artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.libname.outputs.NAME }}
path: ./build/${{ steps.libname.outputs.NAME }}
if-no-files-found: error


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


- name: Upload QMOD
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.module_id }}-(UNZIP-for-QMOD).qmod
path: ./${{ env.module_id }}_${{ env.version }}.qmod
Expand Down
71 changes: 38 additions & 33 deletions .github/workflows/buildModPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
submodules: true
lfs: true

- name: Get Version
shell: pwsh
run: |
$branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "version=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Split('-')[0])-$($branchMain).${{ github.run_number }}+$($branchSub)ra${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: seanmiddleditch/gha-setup-ninja@v3

# - name: Install Powershell
Expand Down Expand Up @@ -50,60 +56,61 @@ jobs:


# extract branch name
- name: Extract branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
id: extract_branch
# - name: Extract branch name
# if: github.event_name != 'pull_request'
# shell: bash
# run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
# id: extract_branch

# extract branch name on pull request
- name: Print branch name
if: github.event_name == 'pull_request'
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
# - name: Print branch name
# if: github.event_name == 'pull_request'
# run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV

- name: Set version
run: echo "version=$(echo $version_num-$BRANCH_NAME.${{ github.run_number }})" >> $GITHUB_ENV
# - name: Set version
# run: echo "version=$(echo $version_num-$BRANCH_NAME.${{ github.run_number }})" >> $GITHUB_ENV

# print branch name and version
- name: Get branch name
run: |
echo 'The branch name is' $BRANCH_NAME
echo 'The version is' $version
# - name: Get branch name
# run: |
# echo 'The branch name is' $BRANCH_NAME
# echo 'The version is' $version

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

- name: Get QPM
if: steps.cache-qpm.outputs.cache-hit != 'true'
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: cargo-build.yml
name: linux-qpm-rust
name: linux-qpm
path: QPM
repo: RedBrumbler/QuestPackageManager-Rust
repo: QuestPackageManager/QPM.CLI

- name: QPM Collapse
run: |
chmod +x ./QPM/qpm-rust
./QPM/qpm-rust collapse
chmod +x ./QPM/qpm
./QPM/qpm collapse
- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v3
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: /home/runner/.local/share/QPM-Rust/cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.json', '.github/BuildQSounds.yml') }}
path: /home/runner/.local/share/QPM-RS/cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.shared.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-${{ env.cache-name }}
- name: QPM Restore
- name: QPM Set Version & Restore
run: |
./QPM/qpm-rust restore
./QPM/qpm package edit --version ${{ env.version }}
./QPM/qpm restore
- name: Check dependency Folders
run: |
Expand All @@ -113,16 +120,14 @@ jobs:
echo "Checking libs"
ls -lh ${GITHUB_WORKSPACE}/extern/libs
echo ""
echo "Checking QPM-Rust/cache Folder"
ls -lh $HOME/.local/share/QPM-Rust/cache
echo "Checking QPM/cache Folder"
ls -lh $HOME/.local/share/QPM-RS/cache
echo ""
- name: Build
run: |
cd ${GITHUB_WORKSPACE}
./QPM/qpm-rust package edit --version ${{ env.version }}
./QPM/qpm-rust qmod build
pwsh -Command ./build.ps1 --actions
pwsh -Command ./build.ps1 -actions
- name: Get Library Name
id: libname
Expand All @@ -135,7 +140,7 @@ jobs:
- name: Package QMOD
run: |
cd ${GITHUB_WORKSPACE}
pwsh -Command ./buildQMOD.ps1 -package
./QPM/qpm qmod zip -i ./build/ -i ./extern/libs/ ${module_id}_${version}.qmod
- name: Upload non-debug artifact
Expand All @@ -155,7 +160,7 @@ jobs:


- name: Upload QMOD
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.module_id }}-(UNZIP-for-QMOD).qmod
path: ./${{ env.module_id }}_${{ env.version }}.qmod
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ out/
*.zip
extern/
Android.mk.backup
qpm.shared.json

log_timestamp

Expand All @@ -65,3 +64,5 @@ ndkpath.txt
*.log
.vscode/launch.json.bak
mod.json
tombstone_*
.cache
17 changes: 8 additions & 9 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@
"${workspaceFolder}/shared",
"${workspaceFolder}/include",
"${workspaceFolder}/extern/includes/**",
"${workspaceFolder}/extern/includes/codegen/include",
"${workspaceFolder}/extern/includes/bs-cordl/include",
"${workspaceFolder}/extern/includes/libil2cpp/il2cpp/libil2cpp",
"${NdkPath}/**"
"${ANDROID_NDK_HOME}/**"
],
"name": "Quest",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "linux-clang-arm64",
"configurationProvider": "ms-vscode.cmake-tools",
"compilerPath": "${NdkPath}/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe",
"compilerPath": "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe",
"forcedInclude": [],
"browse": {
"path": [
"${NdkPath}/sources/cxx-stl/llvm-libc++/include",
"${NdkPath}/sources/cxx-stl/llvm-libc++abi/include",
"${NdkPath}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include",
"${NdkPath}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/local/include",
"${NdkPath}"
"${ANDROID_NDK_HOME}/sources/cxx-stl/system/include",
"${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include",
"${ANDROID_NDK_HOME}"
]
}
},
"mergeConfigurations": true
}
],
"version": 4
Expand Down
Loading

0 comments on commit ffac0ba

Please sign in to comment.