Skip to content

Commit

Permalink
Merge pull request #91 from eXhumer/main
Browse files Browse the repository at this point in the history
  • Loading branch information
OMGDuke authored Oct 5, 2024
2 parents b5f458c + eb9fb19 commit 1b9fac8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 19 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,62 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install Dependencies
run: npm install
- name: build
run: npm run build
- name: copy files into build
run: pnpm install

- name: Build frontend
run: pnpm run build

- name: Download Decky Plugin CLI
run: |
cp plugin.json ./dist/
mkdir ./dist/dist
mv ./dist/index.js ./dist/dist/
mkdir $(pwd)/cli
curl -L -o $(pwd)/cli/decky "https://github.com/SteamDeckHomebrew/cli/releases/latest/download/decky-linux-x86_64"
chmod +x $(pwd)/cli/decky
- name: Build plugin
run: |
$(pwd)/cli/decky plugin build $(pwd)
unzip "out/Game Theme Music.zip" -d "out/Game Theme Music"
- name: Upload package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SDH-GameThemeMusic
path: |
./dist/*
./out/Game Theme Music/*
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: SDH-GameThemeMusic
path: SDH-GameThemeMusic

- name: zip/tar release
run: |
zip -r SDH-GameThemeMusic.zip SDH-GameThemeMusic/*
tar -czvf SDH-GameThemeMusic.tar.gz SDH-GameThemeMusic
- name: Create a release
uses: ncipollo/release-action@v1
with:
artifacts: 'SDH-GameThemeMusic.zip,SDH-GameThemeMusic.tar.gz'
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Game Theme Music",
"author": "OMGDuke",
"flags": [],
"api_version": 2,
"api_version": 1,
"publish": {
"tags": ["audio"],
"description": "Play theme songs on your game pages",
Expand Down
13 changes: 9 additions & 4 deletions src/lib/patchContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ const contextMenuPatch = (LibraryContextMenu: any) => {
component.type.prototype,
'shouldComponentUpdate',
([nextProps]: any, shouldUpdate: any) => {
const gtmIdx = nextProps.children.findIndex(
(x: any) => x?.key === 'game-theme-music-change-music'
)
if (gtmIdx != -1) nextProps.children.splice(gtmIdx, 1)
try {
const gtmIdx = nextProps.children.findIndex(
(x: any) => x?.key === 'game-theme-music-change-music'
)
if (gtmIdx != -1) nextProps.children.splice(gtmIdx, 1)
}
catch (e) {
return component;
}

if (shouldUpdate === true) {
let updatedAppid: number = appid
Expand Down

0 comments on commit 1b9fac8

Please sign in to comment.