Compare commits

...

7 commits

Author SHA1 Message Date
08c72152d0
feat/ci: re-enable windows build
Some checks failed
YAMPD Build / linux-build (push) Has been cancelled
YAMPD Build / windows-build (push) Has been cancelled
2025-06-25 16:24:14 +05:00
40c68ba972
fix/ci: use the right dist file name 2025-06-25 16:18:44 +05:00
5b532e8e16
fix/ci: upload artifact file path 2025-06-25 16:08:56 +05:00
46f0674302
fix/ci: use the .build additional deps for python instead of .dev 2025-06-25 16:05:02 +05:00
b815947e61
fix/ci: linux 2025-06-25 16:01:12 +05:00
dd84020851
feat/ci: add build ci 2025-06-25 15:19:21 +05:00
43d09314ff
refactor: use shell=True on subproccess call only on nt systems
should fix linux usage
2025-06-21 00:02:09 +05:00
5 changed files with 108 additions and 5 deletions

95
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,95 @@
name: "YAMPD Build"
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: "build"
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build_linux:
name: "linux-build"
runs-on: ubuntu-latest
steps:
- name: "[Preparing] cloning repository"
uses: actions/checkout@v4
- name: "[DEPS/Tool] bun"
uses: oven-sh/setup-bun@v2
- name: "[DEPS/Tool] python"
uses: actions/setup-python@v5
with:
python-version: '3.13.2'
cache: 'pip'
- name: "[DEBUG] check if pip is installed"
run: |
which pip
pip --version
- name: "[DEPS/Build] Backend"
run: |
pip install -r requirements.txt
pip install -r requirements.build.txt
- name: "[DEPS/Build] Frontend"
run: bun install
working-directory: ./gui
- name: "[Build] Building artifact"
run: python ./build.py --exe
- name: "[Publish] Upload GUI Artifact"
uses: actions/upload-artifact@v4
with:
name: "YAMPD-gui-linux"
path: "./dist/yamcpack"
if-no-files-found: warn
retention-days: 14
- name: "[Publish] Upload CLI Artifact"
uses: actions/upload-artifact@v4
with:
name: "YAMPD-cli-linux"
path: "./dist/yamcpack-cli"
if-no-files-found: warn
retention-days: 14
build_windows:
name: "windows-build"
runs-on: windows-latest
steps:
- name: "[Preparing] cloning repository"
uses: actions/checkout@v4
- name: "[DEPS/Tool] bun"
uses: oven-sh/setup-bun@v2
- name: "[DEPS/Tool] python"
uses: actions/setup-python@v5
with:
python-version: '3.13.2'
cache: 'pip'
- name: "[DEPS/Build] Backend"
run: |
pip install -r requirements.txt
pip install -r requirements.build.txt
- name: "[DEPS/Build] Frontend"
run: "bun install"
working-directory: ./gui
- name: "[Build] Building artifact"
run: python ./build.py --exe
- name: "[Publish] Upload GUI Artifact"
uses: actions/upload-artifact@v4
with:
name: "YAMPD-gui-windows.exe"
path: "./dist/yamcpack.exe"
if-no-files-found: warn
retention-days: 14
- name: "[Publish] Upload CLI Artifact"
uses: actions/upload-artifact@v4
with:
name: "YAMPD-cli-windows.exe"
path: "./dist/yamcpack-cli.exe"
if-no-files-found: warn
retention-days: 14

View file

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import subprocess
import os
import shutil
@ -56,7 +58,7 @@ if __name__ == "__main__":
# TODO?: install node deps automatically
if not args.no_rebuild:
build = subprocess.call(["bun", "run", "build"], cwd="./gui", shell=True)
build = subprocess.call(["bun", "run", "build"], cwd="./gui", shell=(os.name == "nt"))
if build != 0:
print("[ERROR] Next.js gui has failed to build")
raise
@ -110,7 +112,7 @@ if __name__ == "__main__":
"templates:templates",
],
cwd="./dist",
shell=True,
shell=(os.name == "nt"),
)
if build != 0:
print("[ERROR] pyinstaller has failed to build an app")
@ -140,7 +142,7 @@ if __name__ == "__main__":
"mc_version.json:.",
],
cwd="./dist",
shell=True,
shell=(os.name == "nt"),
)
if build != 0:
print("[ERROR] pyinstaller has failed to build an app")

6
dev.py
View file

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import subprocess
import time
import os
@ -13,10 +15,10 @@ if __name__ == "__main__":
# TODO?: install node deps automatically
gui_proc = subprocess.Popen(
["bun", "run", "dev"], cwd="./gui", env=environment, shell=True
["bun", "run", "dev"], cwd="./gui", env=environment, shell=(os.name == "nt")
)
app_proc = subprocess.Popen(
["python", "main.py"], cwd="./src", env=environment, shell=True
["python", "main.py"], cwd="./src", env=environment, shell=(os.name == "nt")
)
try:

View file

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import os
from sys import exit

View file

@ -1,3 +1,5 @@
#!/usr/bin/env python3
from flask import Flask
from flask import render_template, send_file, abort
from flaskwebgui import FlaskUI # import FlaskUI