Skip to content

Commit

Permalink
Fix context menu key
Browse files Browse the repository at this point in the history
  • Loading branch information
OMGDuke committed Apr 9, 2024
1 parent 7334b5a commit e5a8d05
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 59 deletions.
106 changes: 50 additions & 56 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,56 @@
name: Build and Release Game Theme Music

on:
push:
tags:
- 'v*'
pull_request:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
tags:
- 'v*'
pull_request:
branches: ['main']
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '18.3'

- name: Install Dependencies
run: npm install

- name: build
run: npm run build

- name: copy files into build
run: |
cp plugin.json ./dist/
mkdir ./dist/dist
mv ./dist/index.js ./dist/dist/
- name: Upload package
uses: actions/upload-artifact@v2
with:
name: SDH-GameThemeMusic
path: |
./dist/*
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v3
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 }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install Dependencies
run: npm install
- name: build
run: npm run build
- name: copy files into build
run: |
cp plugin.json ./dist/
mkdir ./dist/dist
mv ./dist/index.js ./dist/dist/
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: SDH-GameThemeMusic
path: |
./dist/*
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
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 }}
6 changes: 3 additions & 3 deletions src/lib/patchContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ const contextMenuPatch = (LibraryContextMenu: any) => {
component.type.prototype,
'shouldComponentUpdate',
([nextProps]: any, shouldUpdate: any) => {
const sgdbIdx = nextProps.children.findIndex(
(x: any) => x?.key === 'sgdb-change-artwork'
const gtmIdx = nextProps.children.findIndex(
(x: any) => x?.key === 'game-theme-music-change-music'
)
if (sgdbIdx != -1) nextProps.children.splice(sgdbIdx, 1)
if (gtmIdx != -1) nextProps.children.splice(gtmIdx, 1)

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

0 comments on commit e5a8d05

Please sign in to comment.