Skip to content

Commit

Permalink
Merge pull request #1 from Wasted-Audio/feature/poetry
Browse files Browse the repository at this point in the history
Feature/poetry
  • Loading branch information
dromer authored Sep 27, 2024
2 parents e594c9f + bbefc4e commit a706955
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/run_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,32 @@ jobs:
runs-on: macos-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
working-directory: ${{github.workspace}}
run: brew install dfu-util

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Run Packaging Script
working-directory: ${{github.workspace}}
run:
CLEAR_INTL=1 ./build.sh

- name: Archive Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Heavy-MacOS-Universal
path: ${{github.workspace}}/Heavy

- name: Release Artifacts
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
Expand All @@ -42,23 +47,28 @@ jobs:
- name: Install Packages
run: choco install make -y

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Run Packaging Script
working-directory: ${{github.workspace}}
run:
./build.bat

- name: Archive Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Heavy-Win64
path: ${{github.workspace}}/Heavy

- name: Release Artifacts
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
Expand All @@ -70,27 +80,33 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Install Dependencies (apt)
run: sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update && sudo apt install -y git binutils python3.11-full curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util
run: sudo apt update && sudo apt install -y git binutils curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util
#deps for build-anywhere: csh gawk autoconf automake autotools-dev wget m4 flex bison texinfo unzip help2man meson gperf lzip libtool-bin patch ninja-build libstdc++6 libncurses5-dev
- uses: actions/checkout@v3

- uses: actions/checkout@v4
with:
submodules: recursive
env:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Run Packaging Script
working-directory: ${{github.workspace}}
run:
bash ./build.sh

- name: Archive Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Heavy-Linux-x64
path: ${{github.workspace}}/Heavy

- name: Release Artifacts
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
Expand Down
15 changes: 6 additions & 9 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,15 @@ xcopy /E /H /C /I dpf-widgets Heavy\usr\lib\dpf-widgets

:: Package heavy using pyinstaller
python -m ensurepip
python -m pip install hvcc\.
python -m pip install pyinstaller
python -m pip install poetry poetry-pyinstaller-plugin

FOR /F "tokens=*" %%g IN ('python -m site --user-site') do (SET PYTHON_SITE=%%g)

python resources\run_pyinstaller.py -n Heavy --noconfirm --windowed --paths %PYTHON_SITE% .\hvcc\hvcc\__init__.py --collect-data json2daisy --add-data=".\hvcc\hvcc\generators;.\generators" --add-data=".\hvcc\hvcc\core;.\hvcc\core" --add-data=".\hvcc\hvcc\generators;.\hvcc\generators" --add-data=".\hvcc\hvcc\interpreters;.\hvcc\interpreters"
cd hvcc
poetry build
cd ..

copy .\dist\Heavy\json2daisy\resources\component_defs.json .\dist\Heavy\json2daisy\resources\seed.json
move .\dist\Heavy .\Heavy\usr\bin\
mkdir .\Heavy\usr\bin\Heavy\

del /s /q .\dist\*
del /s /q .\build\*
del /s /q .\__init__.spec
move .\hvcc\dist\pyinstaller\win_amd64\Heavy.exe .\Heavy\usr\bin\Heavy\

cp VERSION Heavy\VERSION
19 changes: 9 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,18 @@ cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets

# Package Heavy with pyinstaller
python3 -m ensurepip
python3 -m pip install hvcc/.
python3 -m pip install pyinstaller
python3 -m pip install poetry poetry-pyinstaller-plugin

pushd hvcc
poetry build
popd

mkdir -p Heavy/bin/Heavy

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
python3 ./resources/run_pyinstaller.py -n Heavy --noconfirm --paths $(python3 -m site --user-site) ./hvcc/hvcc/__init__.py --collect-data json2daisy --add-data="./hvcc/hvcc/generators:./generators" --add-data="./hvcc/hvcc/core:./hvcc/core" --add-data="./hvcc/hvcc/generators:./hvcc/generators" --add-data="./hvcc/hvcc/interpreters:./hvcc/interpreters"
mv ./hvcc/dist/pyinstaller/manylinux_2_31_x86_64/Heavy Heavy/bin/Heavy/
elif [[ "$OSTYPE" == "darwin"* ]]; then
python3 ./resources/run_pyinstaller.py -n Heavy --noconfirm --paths $(python3 -m site --user-site) --target-architecture x86_64 ./hvcc/hvcc/__init__.py --collect-data json2daisy --add-data="./hvcc/hvcc/generators:./generators" --add-data="./hvcc/hvcc/core:./hvcc/core" --add-data="./hvcc/hvcc/generators:./hvcc/generators" --add-data="./hvcc/hvcc/interpreters:./hvcc/interpreters"
mv ./hvcc/dist/pyinstaller/macosx_14_0_arm64/Heavy Heavy/bin/Heavy/
fi

mv ./dist/Heavy Heavy/bin/Heavy

rm -rf ./dist
rm -rf ./build
rm -rf ./Heavy.spec

cp VERSION ./Heavy/VERSION
2 changes: 1 addition & 1 deletion hvcc

0 comments on commit a706955

Please sign in to comment.