-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve build flow and update to bs-hook 4
- Loading branch information
Showing
5 changed files
with
223 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,85 @@ | ||
name: NDK build | ||
|
||
env: | ||
ndkname: android-ndk-r23 | ||
module_id: codegen | ||
qmodName: Codegen | ||
cache-name: codegen_cache | ||
module_id: codegen | ||
qmodName: Codegen | ||
cache-name: codegen_cache | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ master ] | ||
branches: [master] | ||
pull_request: | ||
branches: [ master ] | ||
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 | ||
- 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: QPM Rust Action | ||
uses: Fernthedev/qpm-rust-action@main | ||
with: | ||
#required | ||
workflow_token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
restore: true # will run restore on download | ||
cache: true #will cache dependencies | ||
|
||
# Name of qmod in release asset. Assumes exists, same as prior | ||
qpm_qmod: ${{env.qmodName}}.qmod | ||
|
||
- name: QPM Collapse | ||
run: qpm-rust collapse | ||
|
||
- name: Build | ||
run: | | ||
cd ${GITHUB_WORKSPACE} | ||
qpm-rust s build | ||
- name: Create Qmod | ||
run: | | ||
qpm-rust qmod build | ||
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 debug artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: debug_${{ steps.libname.outputs.NAME }} | ||
path: ./build/debug_${{ 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 |
Oops, something went wrong.