generated from SteamDeckHomebrew/Plugin-Template
-
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.
Merge pull request #79 from suchmememanyskill/dev
v1.6.0
- Loading branch information
Showing
24 changed files
with
603 additions
and
280 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ on: ["push", "pull_request", "workflow_dispatch"] | |
|
||
jobs: | ||
build: | ||
name: Build SDH-CSSLoader | ||
name: Build SDH-CSSLoader for Decky | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
|
@@ -35,12 +35,51 @@ jobs: | |
- name: Upload package artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: SDH-CSSLoader | ||
name: SDH-CSSLoader-Decky | ||
path: ./build.zip | ||
|
||
- name: Send Zip in discord | ||
uses: tsickert/[email protected] | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
with: | ||
webhook-url: ${{ secrets.WEBHOOK_URL }} | ||
content: ${{ github.event.head_commit.message }} | ||
filename: "./build.zip" | ||
|
||
build-standalone-win: | ||
name: Build SDH-CSSLoader Standalone for Windows | ||
runs-on: windows-2022 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10.2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10.2" | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pyinstaller==5.5 | ||
pip install -r requirements.txt | ||
- name: Get inject.py dependency from decky-loader | ||
run: | | ||
git clone --depth=1 https://github.com/SteamDeckHomebrew/decky-loader | ||
copy ./decky-loader/backend/injector.py injector.py | ||
- name: Build Python Backend | ||
run: pyinstaller --noconfirm --onefile --name "CssLoader-Standalone" ./main.py ./injector.py | ||
|
||
- name: Build Python Backend Headless | ||
run: pyinstaller --noconfirm --noconsole --onefile --name "CssLoader-Standalone-Headless" ./main.py ./injector.py | ||
|
||
- name: Upload package artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: SDH-CSSLoader-Win-Standalone | ||
path: | | ||
./dist/CssLoader-Standalone.exe | ||
./dist/CssLoader-Standalone-Headless.exe |
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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import asyncio, aiohttp.web, json | ||
from css_utils import Log, create_cef_flag | ||
|
||
PLUGIN_CLASS = None | ||
|
||
async def handle(request : aiohttp.web.BaseRequest): | ||
data = await request.json() | ||
request_result = {"res": None, "success": True} | ||
|
||
# This is very cool decky code | ||
try: | ||
request_result["res"] = await getattr(PLUGIN_CLASS, data["method"])(PLUGIN_CLASS, **data["args"]) | ||
except Exception as e: | ||
request_result["res"] = str(e) | ||
request_result["success"] = False | ||
finally: | ||
return aiohttp.web.Response(text=json.dumps(request_result, ensure_ascii=False), content_type='application/json') | ||
|
||
def start_server(plugin): | ||
global PLUGIN_CLASS | ||
|
||
PLUGIN_CLASS = plugin | ||
loop = asyncio.get_running_loop() | ||
create_cef_flag() | ||
app = aiohttp.web.Application(loop=loop) | ||
app.router.add_route('POST', '/req', handle) | ||
loop.create_task(aiohttp.web._run_app(app, host="127.0.0.1", port=35821)) | ||
Log("Started CSS_Loader server on port 35821") |
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
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
Oops, something went wrong.