Compare commits

...

6 Commits

Author SHA1 Message Date
botato b00b04ceeb Fix action not detecting prerelease 2022-07-11 17:41:11 -04:00
botato 470f16adda CI revamp (#110)
* ci: automatically make releases, ...

- option to run manually (for full-fledged releases)
- cron schedule for pre-releases (every day at 1 pm UTC)
- semantic versioning
- Automatically generated release description

* formatting

* more formatting .-.

* Tweak according to latest release
2022-07-11 09:13:56 +02:00
botato 76424174ed Use call instead of Popen (#113) 2022-07-11 08:56:36 +02:00
AAGaming b618fe1e97 bump lib 2022-07-07 00:03:56 -04:00
AAGaming 45949e8456 support non-ui plugins 2022-07-07 00:03:20 -04:00
TrainDoctor e3a965329d Update install_prerelease.sh 2022-07-04 08:27:44 -07:00
7 changed files with 116 additions and 42 deletions
+89 -19
View File
@@ -2,52 +2,122 @@ name: Builder
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
schedule:
- cron: '0 13 * * *' # run at 1 PM UTC
workflow_dispatch:
inputs:
release:
type: choice
description: Release the asset
default: 'none'
options:
- none
- prerelease
- release
permissions:
contents: read
contents: write
jobs:
build:
name: Packager
name: Build PluginLoader
runs-on: ubuntu-latest
steps:
- name: 🧰 Checkout
- name: Checkout 🧰
uses: actions/checkout@v3
- name: 💎 Set up NodeJS 17
- name: Set up NodeJS 17 💎
uses: actions/setup-node@v3
with:
node-version: 17
- name: 🐍 Set up Python 3.10
- name: Set up Python 3.10 🐍
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: ⬇️ Install Python dependencies
- name: Install Python dependencies ⬇️
run: |
python -m pip install --upgrade pip
pip install pyinstaller
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
[ -f requirements.txt ] && pip install -r requirements.txt
- name: ⬇️ Install NodeJS dependencies
- name: Install NodeJS dependencies ⬇️
run: |
cd frontend
npm i
npm run build
- name: 🛠️ Build
run: |
pyinstaller --noconfirm --onefile --name "PluginLoader" --add-data ./backend/static:/static --add-data ./backend/legacy:/legacy ./backend/*.py
- name: Build 🛠️
run: pyinstaller --noconfirm --onefile --name "PluginLoader" --add-data ./backend/static:/static --add-data ./backend/legacy:/legacy ./backend/*.py
- name: ⬆️ Upload package
uses: actions/upload-artifact@v2
- name: Upload package artifact ⬆️
uses: actions/upload-artifact@v3
with:
name: Plugin Loader
path: |
./dist/PluginLoader
name: PluginLoader
path: ./dist/PluginLoader
release:
name: Release the package
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'release' }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout 🧰
uses: actions/checkout@v3
- name: Fetch package artifact ⬇️
uses: actions/download-artifact@v3
with:
name: PluginLoader
path: dist
- name: Bump version and push tag ⏫
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Release 📦
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.tag_version.outputs.new_tag }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
files: ./dist/PluginLoader
generate_release_notes: true
nightly:
name: Release the nightly version of the package
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'prerelease') }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout 🧰
uses: actions/checkout@v3
- name: Fetch package artifact ⬇️
uses: actions/download-artifact@v3
with:
name: PluginLoader
path: dist
- name: Bump version and push tag ⏫
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pre_release_branches: 'main'
append_to_pre_release_tag: '-pre'
- name: Release 📦
uses: softprops/action-gh-release@v1
with:
name: Nightly ${{ steps.tag_version.outputs.new_tag }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
files: ./dist/PluginLoader
prerelease: true
generate_release_notes: true
+5 -3
View File
@@ -17,7 +17,7 @@ basicConfig(level=CONFIG["log_level"], format="[%(module)s][%(levelname)s]: %(me
from asyncio import get_event_loop, sleep
from json import dumps, loads
from os import path
from subprocess import Popen
from subprocess import call
import aiohttp_cors
from aiohttp.web import Application, run_app, static
@@ -31,8 +31,10 @@ from utilities import Utilities
logger = getLogger("Main")
async def chown_plugin_dir(_):
Popen(["chown", "-R", "deck:deck", CONFIG["plugin_path"]])
Popen(["chmod", "-R", "555", CONFIG["plugin_path"]])
code_chown = call(["chown", "-R", "deck:deck", CONFIG["plugin_path"]])
code_chmod = call(["chmod", "-R", "555", CONFIG["plugin_path"]])
if code_chown != 0 or code_chmod != 0:
logger.error(f"chown/chmod exited with a non-zero exit code (chown: {code_chown}, chmod: {code_chmod})")
class PluginManager:
def __init__(self) -> None:
+2 -2
View File
@@ -2,7 +2,7 @@
[ "$UID" -eq 0 ] || exec sudo "$0" "$@"
echo "Installing Steam Deck Plugin Loader release..."
echo "Installing Steam Deck Plugin Loader pre-release..."
HOMEBREW_FOLDER=/home/deck/homebrew
@@ -12,7 +12,7 @@ sudo -u deck mkdir -p ${HOMEBREW_FOLDER}/services
sudo -u deck mkdir -p ${HOMEBREW_FOLDER}/plugins
# Download latest release and install it
DOWNLOADURL="$(curl -s 'https://api.github.com/repos/SteamDeckHomebrew/PluginLoader/releases' | jq -r "first(.[] | select(.prerelease == "true"))" | jq -r ".assets[].browser_download_url")"
DOWNLOADURL="$(curl -s 'https://api.github.com/repos/SteamDeckHomebrew/decky-loader/releases' | jq -r "first(.[] | select(.prerelease == "true"))" | jq -r ".assets[].browser_download_url")"
# printf "DOWNLOADURL=$DOWNLOADURL\n"
curl -L $DOWNLOADURL --output ${HOMEBREW_FOLDER}/services/PluginLoader
chmod +x ${HOMEBREW_FOLDER}/services/PluginLoader
+1 -1
View File
@@ -37,7 +37,7 @@
}
},
"dependencies": {
"decky-frontend-lib": "^1.0.1",
"decky-frontend-lib": "^1.0.2",
"react-icons": "^4.4.0"
}
}
+4 -4
View File
@@ -9,7 +9,7 @@ specifiers:
'@types/react': 16.14.0
'@types/react-router': 5.1.18
'@types/webpack': ^5.28.0
decky-frontend-lib: ^1.0.1
decky-frontend-lib: ^1.0.2
husky: ^8.0.1
import-sort-style-module: ^6.0.0
inquirer: ^8.2.4
@@ -23,7 +23,7 @@ specifiers:
typescript: ^4.7.4
dependencies:
decky-frontend-lib: 1.0.1
decky-frontend-lib: 1.0.2
react-icons: 4.4.0_react@16.14.0
devDependencies:
@@ -806,8 +806,8 @@ packages:
ms: 2.1.2
dev: true
/decky-frontend-lib/1.0.1:
resolution: {integrity: sha512-SgIPoB3IcWbzVRlXvs8JfhwrMphHYa7O/Ek2mh+rC0WTVT3TI2qGJ5+OoV16mw5kGY0DMu1ikcZC6ib1lh2zKQ==}
/decky-frontend-lib/1.0.2:
resolution: {integrity: sha512-l2Fq1oKkZdi2W4Qq+EXWgwOynWgANLTSFHcHrbJwCimTJ75uPlvrtsulnh5PlIovydM6iC+NyjAbW/qsVXWeLg==}
dev: false
/deepmerge/4.2.2:
+12 -10
View File
@@ -12,16 +12,18 @@ const PluginView: VFC = () => {
return (
<PanelSection>
{plugins.map(({ name, icon }) => (
<PanelSectionRow key={name}>
<ButtonItem layout="below" onClick={() => setActivePlugin(name)}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>{icon}</div>
<div>{name}</div>
</div>
</ButtonItem>
</PanelSectionRow>
))}
{plugins
.filter((p) => p.content)
.map(({ name, icon }) => (
<PanelSectionRow key={name}>
<ButtonItem layout="below" onClick={() => setActivePlugin(name)}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>{icon}</div>
<div>{name}</div>
</div>
</ButtonItem>
</PanelSectionRow>
))}
</PanelSection>
);
};
+3 -3
View File
@@ -1,6 +1,6 @@
export interface Plugin {
name: any;
content: any;
icon: any;
name: string;
icon: JSX.Element;
content?: JSX.Element;
onDismount?(): void;
}