From 54097583b3446ffcb9e66debecb6a09d02d57c29 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Fri, 29 Mar 2024 16:38:10 +0000 Subject: [PATCH] fix(ci): use poetry --- .github/workflows/build.yaml | 4 ++++ build/build-exe.py | 4 ++-- build/build-linux.sh | 7 ++----- build/build-macos.sh | 9 +++------ build/build-windows.bat | 11 ++--------- 5 files changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ab96de7..804a502 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,6 +55,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Setup poetry + uses: Gr1N/setup-poetry@v8 - uses: actions/checkout@v2 - name: Set up Node ${{ matrix.node-version }} uses: actions/setup-node@v2 @@ -91,6 +93,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Setup poetry + uses: Gr1N/setup-poetry@v8 - uses: actions/checkout@v2 - name: Set up Node ${{ matrix.node-version }} uses: actions/setup-node@v2 diff --git a/build/build-exe.py b/build/build-exe.py index 8a46cd8..ec8ac82 100644 --- a/build/build-exe.py +++ b/build/build-exe.py @@ -6,9 +6,9 @@ config = json.loads(file.read()) file.close() if isLinux(): - cmd_str = "python3 -m PyInstaller " + cmd_str = "poetry run python3 -m PyInstaller " else: - cmd_str = "pyinstaller " + cmd_str = "poetry run pyinstaller " json_dests = ["icon_file", "clean_build"] pyi_dests = ["icon", "clean"] diff --git a/build/build-linux.sh b/build/build-linux.sh index 6e3b4b1..df39674 100755 --- a/build/build-linux.sh +++ b/build/build-linux.sh @@ -11,16 +11,13 @@ echo "BRANCH: str = \"$build_branch\"" >> ../build.py sudo apt install libportaudio2 sudo apt install python3-pip python3-venv ffmpeg -python3 -m venv ../venv -source ../venv/bin/activate - poetry install -python3 ./generate-build-exe-config.py +poetry run python3 ./generate-build-exe-config.py chmod +x output/BAPSicle -python3 ./build-exe.py +poetry run python3 ./build-exe.py bash ./build-exe-pyinstaller-command.sh diff --git a/build/build-macos.sh b/build/build-macos.sh index 9d3bb98..5c48efd 100755 --- a/build/build-macos.sh +++ b/build/build-macos.sh @@ -8,21 +8,18 @@ build_branch="$(git branch --show-current)" echo "BUILD: str = \"$build_commit\"" > ../build.py echo "BRANCH: str = \"$build_branch\"" >> ../build.py -python3 -m venv ../venv -source ../venv/bin/activate - poetry install -python3 ./generate-build-exe-config.py +poetry run python3 ./generate-build-exe-config.py -python3 ./build-exe.py +poetry run python3 ./build-exe.py bash ./build-exe-pyinstaller-command.sh rm ./*.spec cd ../ -python3 build/generate-platypus-config.py +poetry run python3 build/generate-platypus-config.py cd build brew install platypus diff --git a/build/build-windows.bat b/build/build-windows.bat index ef1d25b..b925c9b 100644 --- a/build/build-windows.bat +++ b/build/build-windows.bat @@ -10,21 +10,14 @@ SET build_branch=%%F echo BUILD: str = "%build_commit%"> ..\build.py echo BRANCH: str = "%build_branch%">> ..\build.py -if "%1" == "no-venv" goto skip-venv - - py -m venv ..\venv - ..\venv\Scripts\activate - -:skip-venv - poetry install : Generate the json config in case you wanted to use the gui to regenerate the command below manually. -python generate-build-exe-config.py +poetry run python generate-build-exe-config.py : auto-py-to-exe -c build-exe-config.json -o ../install -python build-exe.py +poetry run python build-exe.py build-exe-pyinstaller-command.bat