add Nuitka action, minor bug fix

This commit is contained in:
csd4ni3l
2025-05-24 10:38:19 +02:00
parent 26b9f17970
commit d3d36e5250
3 changed files with 93 additions and 2 deletions

92
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Build and Release
on: push
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: "x64"
cache: "pip"
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Build Executable
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: run.py
nofollow-import-to: "*tk*,_codecs,encodings,multiprocessing,gi"
disable-plugins: tk-inter,dill-compat,eventlet,gevent,pyqt5,pyqt6,pyside2,pyside6,delvewheel,pywebview,matplotlib,spacy,enum-compat,pbr-compat,gevent,pmw-freezer,transformers,upx,kivy,options-nanny,multiprocessing,gi
include-data-dir: assets=assets
include-data-files: CREDITS=CREDITS
mode: standalone
output-file: MusicPlayer
- name: Zip Build Output
shell: bash
run: |
mkdir -p zip_output
if [ "${{ runner.os }}" = "Windows" ]; then
powershell.exe -Command "Compress-Archive -Path 'build/run.dist/*' -DestinationPath 'zip_output/MusicPlayer-${{ runner.os }}.zip'"
else
cd build/run.dist
zip -r "../../zip_output/MusicPlayer-${{ runner.os }}.zip" .
fi
- name: Upload Zipped Build Artifact
uses: actions/upload-artifact@v4
with:
name: MusicPlayer-${{ runner.os }}.zip
path: zip_output/MusicPlayer-${{ runner.os }}.zip
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download All Zipped Builds
uses: actions/download-artifact@v4
with:
path: downloads
- name: Delete Old Release (if exists)
continue-on-error: true
run: gh release delete latest -y
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete Git tag (if exists)
continue-on-error: true
run: |
git push origin :refs/tags/latest
git tag -d latest
- name: Recreate Git tag at HEAD
run: |
git tag latest
git push origin latest
- name: Create the new release
run: gh release create latest downloads/**/MusicPlayer-*.zip --title "Latest Build" --notes "Most recent multi-platform builds of MusicPlayer"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -110,7 +110,7 @@ class Downloader(arcade.gui.UIView):
try:
audio = AudioSegment.from_file("downloaded_music.mp3")
if audio.dBFS < self.settings_dict.get("normalized_volume", -8):
if int(audio.dBFS) != self.settings_dict.get("normalized_volume", -8):
change = self.settings_dict.get("normalized_volume", -8) - audio.dBFS
audio = audio.apply_gain(change)

View File

@@ -5,7 +5,6 @@ from utils.preload import *
from utils.constants import button_style, slider_style, audio_extensions, discord_presence_id
from utils.utils import FakePyPresence, UIFocusTextureButton, extract_metadata, truncate_end
from arcade.gui.property import bind
from thefuzz import process, fuzz
from pydub import AudioSegment