Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ATXLtheAxolotl committed Mar 19, 2022
1 parent 6a4763c commit bc0b614
Show file tree
Hide file tree
Showing 5,002 changed files with 1,214,826 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
106 changes: 106 additions & 0 deletions .github/workflows/buildndk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: NDK build

env:
ndkname: android-ndk-r23
module_id: bvr-codegen
qmodName: BVR-Codegen
cache-name: codegen_cache

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
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: 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
path: QPM
repo: RedBrumbler/QuestPackageManager-Rust

- name: QPM Collapse
run: |
chmod +x ./QPM/qpm-rust
./QPM/qpm-rust collapse
- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: /home/runner/.local/share/QPM-Rust/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('qpm.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: QPM Restore
run: |
chmod +x ./QPM/qpm-rust
./QPM/qpm-rust restore
- name: List Post Restore
run: |
echo includes:
ls -la ${GITHUB_WORKSPACE}/extern/includes
echo libs:
ls -la ${GITHUB_WORKSPACE}/extern/libs
echo cache:
ls -la $HOME/.local/share/QPM-Rust/cache
- name: Build
run: |
cd ${GITHUB_WORKSPACE}
./QPM/qpm-rust qmod build --isLibrary=true
pwsh -Command ./build.ps1
- name: Create Qmod
run: |
pwsh -Command ./createqmod.ps1 ${{env.qmodName}}
- name: Get Library Name
id: libname
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo ::set-output name=NAME::"${files[0]}"
- name: Upload non-debug artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.libname.outputs.NAME }}
path: ./build/${{ steps.libname.outputs.NAME }}
if-no-files-found: error

- name: Upload qmod artifact
uses: actions/upload-artifact@v2
with:
name: ${{env.qmodName}}.qmod
path: ./${{ env.qmodName }}.qmod
if-no-files-found: error
199 changes: 199 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: Publish QPM Package

env:
ndkname: android-ndk-r23
module_id: bvr-codegen
qmodName: BVR-Codegen
cache-name: codegen_cache

on:
push:
tags:
- 'v*'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
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: 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
path: QPM
repo: RedBrumbler/QuestPackageManager-Rust

- name: QPM Collapse
run: |
chmod +x ./QPM/qpm-rust
./QPM/qpm-rust collapse
# added the cache on the off chance the qpm.json stays the same across versions
- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: /home/runner/.local/share/QPM-Rust/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('qpm.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: QPM Restore
run: |
chmod +x ./QPM/qpm-rust
./QPM/qpm-rust restore
- name: List Post Restore
run: |
echo includes:
ls -la ${GITHUB_WORKSPACE}/extern/includes
echo libs:
ls -la ${GITHUB_WORKSPACE}/extern/libs
echo cache:
ls -la $HOME/.local/share/QPM-Rust/cache
- name: Get Tag Version
id: get_tag_version
run: |
echo ${GITHUB_REF#refs/tags/}
echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: QPM Edit Version
run: |
./QPM/qpm-rust package edit --version "${{ steps.get_tag_version.outputs.VERSION }}"
- name: Build
run: |
cd ${GITHUB_WORKSPACE}
./QPM/qpm-rust qmod build --isLibrary=true
pwsh -Command ./build.ps1
- name: Create Qmod
run: |
pwsh -Command ./createqmod.ps1 ${{env.qmodName}}
# Commit the change to the package, .vscode/c_cpp_properties.json, and Android.mk
- name: Configure commit
run: |
git config user.name "Github Actions"
git config user.email "<>"
- name: Commit Edit Version
run: |
git add qpm.json
git commit -m "Update Version and post restore"
# Then, we want to use the commit we have just made, and force push our tag to that commit
- name: Get Commit ID
id: get_commit_id
run: |
echo `git rev-parse HEAD`
echo ::set-output name=ID::`git rev-parse HEAD`
- name: Force create tag
run: |
git tag --force ${{ steps.get_tag_version.outputs.TAG }} ${{ steps.get_commid_id.outputs.ID }}
# Then, push, upload our artifacts, modify the config file to have soLink and debugSoLink
- name: Create and push version specific branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git branch version-${{ steps.get_tag_version.outputs.TAG }}
git push -u origin version-${{ steps.get_tag_version.outputs.TAG }} --force --tags
# Get release that was created for this tag
- name: Get Release
uses: octokit/request-action@v2.x
id: get_release
with:
route: GET /repos/:repository/releases/tags/${{ steps.get_tag_version.outputs.TAG }}
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get Release Upload URL
id: get_upload_url
run: |
url=$(echo "$response" | jq -r '.upload_url')
echo $url
echo "::set-output name=upload_url::$url"
env:
response: ${{ steps.get_release.outputs.data }}

- name: Get Library Name
id: libname
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo ::set-output name=NAME::"${files[0]}"
- name: Upload Release Asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: ./build/${{ steps.libname.outputs.NAME }}
asset_name: ${{ steps.libname.outputs.NAME }}
asset_content_type: application/octet-stream

- name: Upload Qmod Asset
id: upload_qmod_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: ./${{env.qmodName}}.qmod
asset_name: ${{env.qmodName}}.qmod
asset_content_type: application/octet-stream

- name: Change QPM Package Info
run: |
./QPM/qpm-rust package edit-extra --branchName "version-${{ steps.get_tag_version.outputs.TAG }}"
./QPM/qpm-rust package edit-extra --soLink "${{ steps.upload_release_asset.outputs.browser_download_url }}"
./QPM/qpm-rust package edit-extra --modLink "${{ steps.upload_qmod_asset.outputs.browser_download_url }}"
- name: Commit Changed package info
run: |
git add qpm.json
git commit -m "Updated qpm.json"
# Then, we want to use the commit we have just made, and force push our tag to that commit
- name: Get Commit ID
id: get_created_commit_id
run: |
echo `git rev-parse HEAD`
echo ::set-output name=ID::`git rev-parse HEAD`
- name: Push New Commit and Tag
run: |
git push origin HEAD:version-${{ steps.get_tag_version.outputs.TAG }} --force
git tag --force ${{ steps.get_tag_version.outputs.TAG }} ${{ steps.get_created_commit_id.outputs.ID }}
git push --tags --force
- name: QPM Publish
run: ./QPM/qpm-rust publish
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

extern/
qpm.lock.json
*.backup
*.so
ndkpath.txt
obj/
libs/
qpm.shared.json

*.zip
qpm.shared.json
mod.json
extern.cmake
qpm_defines.cmake

build/
*.qmod
25 changes: 25 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"configurations": [
{
"defines": [
"NEED_UNSAFE_CSHARP",
"__GNUC__",
"__aarch64__",
"VERSION=\"0.7.0\"",
"ID=\"il2cpp_codegen\""
],
"includePath": [
"C:/android-ndk-r21d/**",
"${workspaceFolder}/**",
"${workspaceFolder}/include"
],
"name": "Win32",
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.28919/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
Loading

0 comments on commit bc0b614

Please sign in to comment.