Skip to content

Commit

Permalink
Cleanup and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-r-elp committed Jul 10, 2024
1 parent 1695012 commit 5fe95b2
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 125 deletions.
116 changes: 49 additions & 67 deletions .github/workflows/Pre-Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on:

env:
module_id: ClockMod
version: 1.8.0-rc.1
ndkname: android-ndk-r24

prebuildnumber: 0

jobs:
build:
Expand All @@ -19,107 +17,91 @@ jobs:
with:
submodules: true
lfs: true
- 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'
- uses: seanmiddleditch/gha-setup-ninja@v3

- name: Get the tag name
run: echo "version=${GITHUB_REF/refs\/tags\//}-rc.${prebuildnumber}" >> $GITHUB_ENV

- name: Get BSVersion and Version
shell: pwsh
run: |
wget -q -O ndk.zip https://dl.google.com/android/repository/${ndkname}-linux-x86_64.zip
unzip -q ndk.zip
mv ${ndkname} ndk
echo "BSVersion=$((Get-Content ./mod.template.json -Raw | ConvertFrom-Json).packageVersion)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
#echo "version=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Split('-')[0])-rc.$($env:prebuildnumber)"
- name: Create ndkpath.txt
run: |
cd ndk
pwd > ${GITHUB_WORKSPACE}/ndkpath.txt
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: main.yml
name: QPM-ubuntu-x64
workflow: cargo-build.yml
name: linux-qpm
path: QPM
repo: sc2ad/QuestPackageManager

repo: QuestPackageManager/QPM.CLI

- name: QPM Collapse
run: |
chmod +x ./QPM/qpm
./QPM/qpm collapse
- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: QPM_Temp
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm_${{ env.BSVersion }}.json', '.github/BuildMod.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: |
chmod +x ./QPM/QPM
./QPM/QPM restore
./QPM/qpm package edit --version ${{ env.version }}
./QPM/qpm restore
- name: Check dependency Folders
run: |
echo "Checking extern Folder"
ls -lh ${GITHUB_WORKSPACE}/extern/
echo "Checking extern includes"
ls -lh ${GITHUB_WORKSPACE}/extern/includes
echo ""
echo "Checking QPM_Temp Folders"
ls -lh QPM_Temp/
echo "Checking libs"
ls -lh ${GITHUB_WORKSPACE}/extern/libs
echo ""
echo "Listing beatsaber-hook folder"
ls QPM_Temp/beatsaber-hook/
echo "Checking QPM/cache Folder"
ls -lh $HOME/.local/share/QPM-RS/cache
echo ""
echo "Listing all .so files in QPM_Temp"
find QPM_Temp -type f -name "*.so"
- 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
run: |
cd ./libs/arm64-v8a/
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo ::set-output name=NAME::"${files[0]}"
echo "NAME=${files[0]}" >> $GITHUB_OUTPUT
- name: Package QMOD
run: |
cd ${GITHUB_WORKSPACE}
pwsh -Command ./buildQMOD.ps1 -package
- name: Create Release
id: create_pre-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: ${{ env.module_id }} ${{ env.version }} for Beat Saber ${{ env.BSVersion }}
body_path: ./pre-rl-notes.md
draft: false
prerelease: true
- name: Upload QMOD Pre-Release Asset
id: upload-prerelease-QMOD
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
./QPM/qpm qmod zip -i ./build/ -i ./extern/libs/ ${module_id}_${version}.qmod
- name: Pre-Release
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ steps.create_pre-release.outputs.upload_url }}
asset_path: ./${{ env.module_id }}.qmod
asset_name: ${{ env.module_id }}.qmod
asset_content_type: application/qmod
name: ${{ env.module_id }} ${{ env.version }} for Beat Saber ${{ env.BSVersion }}
files: |
./${{ env.module_id }}_${{ env.version }}.qmod
body_path: ./pre-rl-notes.md
generate_release_notes: true
prerelease: true
draft: true
3 changes: 1 addition & 2 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:
- name: Build
run: |
cd ${GITHUB_WORKSPACE}
./QPM/qpm package edit --version ${{ env.version }}
pwsh -Command ./build.ps1 -actions
- name: Get Library Name
Expand All @@ -91,7 +90,7 @@ jobs:
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo ::set-output name=NAME::"${files[0]}"
echo "NAME=${files[0]}" >> $GITHUB_OUTPUT
- name: Package QMOD
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buildMod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo ::set-output name=NAME::"${files[0]}"
echo "NAME=${files[0]}" >> $GITHUB_OUTPUT
- name: Package QMOD
run: |
Expand Down
8 changes: 6 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ echo "Arg $($i) is $($args[$i])"
if ($args.Count -eq 0 -or $actions -ne $true) {
$qpmshared = "./qpm.shared.json"
$qpmsharedJson = Get-Content $qpmshared -Raw | ConvertFrom-Json
$ModID = "ClockMod"
$ModID = $qpmsharedJson.config.info.id
$VERSION = $qpmsharedJson.config.info.version.replace("-Dev", "")
if ($null -eq $VERSION) {
if ([string]::IsNullOrEmpty($VERSION)) {
$VERSION = "0.0.1"
}
if ($release -ne $true) {
Expand All @@ -34,6 +34,10 @@ if ($args.Count -eq 0 -or $actions -ne $true) {
if ($actions -eq $true) {
$ModID = $env:module_id
$VERSION = $env:version
if ([string]::IsNullOrEmpty($VERSION)) {
$qpmsharedJson = Get-Content $qpmshared -Raw | ConvertFrom-Json
$VERSION = $qpmsharedJson.config.info.version.replace("-Dev", "")
}
} else {
& qpm package edit --version $VERSION
}
Expand Down
49 changes: 1 addition & 48 deletions buildQMOD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Param(
[Switch] $package
)

# Builds a .qmod file for loading with QP or BMBF
# Builds a .qmod file for loading with QP or MBF


if ($help -eq $true) {
Expand Down Expand Up @@ -47,25 +47,8 @@ echo "Packaging QMod $qmodName"
echo "Failed to build, exiting..."
exit $LASTEXITCODE
}

# qpm qmod build
}

echo "Creating qmod from mod.json"

# $mod = "./mod.json"
# $modJson = Get-Content $mod -Raw | ConvertFrom-Json

# $filelist = @($mod)

# $cover = "./" + $modJson.coverImage
# if ((-not ($cover -eq "./")) -and (Test-Path $cover))
# {
# $filelist += ,$cover
# } else {
# echo "No cover Image found"
# }

$qpmshared = "./qpm.shared.json"
$qpmsharedJson = Get-Content $qpmshared -Raw | ConvertFrom-Json

Expand All @@ -86,38 +69,8 @@ echo "Actions: Packaging QMod $qmodName"
$qmodName += "_$($qpmsharedJson.config.info.version)"
}

# foreach ($mod in $modJson.lateModFiles)
# {
# $path = "./build/" + $mod
# if (-not (Test-Path $path))
# {
# $path = "./extern/libs/" + $mod
# }
# $filelist += $path
# }

# foreach ($lib in $modJson.libraryFiles)
# {
# $path = "./extern/libs/" + $lib
# if (-not (Test-Path $path))
# {
# $path = "./build/" + $lib
# }
# $filelist += $path
# }

# $zip = $qmodName + ".zip"
$qmod = $qmodName + ".qmod"

# if ((-not ($clean.IsPresent)) -and (Test-Path $qmod))
# {
# echo "Making Clean Qmod"
# Move-Item $qmod $zip -Force
# }

# Compress-Archive -Path $filelist -DestinationPath $zip -Update
# Move-Item $zip $qmod -Force

qpm qmod zip -i ./build/ -i ./extern/libs/ $qmod

echo "Task Completed"
4 changes: 0 additions & 4 deletions include/ClockViewController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "UnityEngine/Color.hpp"
#include "HMUI/CurvedTextMeshPro.hpp"
#include "bsml/shared/BSML/Components/ModalColorPicker.hpp"
//#include "questui/shared/BeatSaberUI.hpp"
//#include "TMPro/TextMeshProUGUI.hpp"

DECLARE_CLASS_CODEGEN(ClockMod, ClockViewController, HMUI::ViewController,

Expand All @@ -17,6 +15,4 @@ DECLARE_CLASS_CODEGEN(ClockMod, ClockViewController, HMUI::ViewController,

custom_types::Helpers::Coroutine UpdateTimeText();
bool SettingsOpen;

//UnityEngine::Color lastChangedColor;
);
1 change: 0 additions & 1 deletion src/ClockViewContoller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ using namespace ClockMod;
#include "bsml/shared/BSML-Lite/Creation/Settings.hpp"
#include "bsml/shared/BSML-Lite/Creation/Text.hpp"

//#include "GlobalNamespace/ColorChangeUIEventType.hpp" // Added for Colorpicker
using namespace UnityEngine;
using namespace HMUI;

Expand Down

0 comments on commit 5fe95b2

Please sign in to comment.