From 9841f67f79e84ee3f982020779f9610c31243c6e Mon Sep 17 00:00:00 2001 From: kodenamekrak <106346717+kodenamekrak@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:24:59 +0000 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 101 ++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7be1e8c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,101 @@ +# Credit to darknight1050 https://github.com/darknight1050/CrashReporter/blob/master/.github/workflows/build-ndk.yml + +name: NDK build + +env: + module_id: qonsistentsabercolors + qmodName: QonsistentSaberColors + +on: + workflow_dispatch: + push: + branches-ignore: + - 'version-v*' + pull_request: + +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: QuestPackageManager/QPM.CLI + + - 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: | + ./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 + 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 so 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