From e378f75c95bdbe324917338635fd4f4aa031556c Mon Sep 17 00:00:00 2001 From: EAR Date: Thu, 17 Oct 2024 20:12:26 -0500 Subject: [PATCH] add windows build workflow --- .github/workflows/linux_build.yml | 7 +--- .github/workflows/windows_build.yml | 57 +++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/windows_build.yml diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index e5b550f..0ec33c1 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -44,6 +44,7 @@ jobs: sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev flutter doctor + - name: Flet Build Linux working-directory: ./GUI run: | @@ -54,14 +55,10 @@ jobs: working-directory: ./GUI run: cp -r ./assets ./dist/assets - - name: Zip dist flder - working-directory: ./GUI - run: zip -r srtranslator.zip ./dist - - name: Upload Linux Artifact uses: actions/upload-artifact@v4.3.4 with: name: linux-build-artifact - path: ./GUI/srtranslator.zip + path: ./GUI/dist if-no-files-found: error overwrite: false diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml new file mode 100644 index 0000000..088f4f0 --- /dev/null +++ b/.github/workflows/windows_build.yml @@ -0,0 +1,57 @@ +name: Windows Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +env: + PYTHON_VERSION: 3.12.2 + FLUTTER_VERSION: 3.24.0 + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Python Dependencies + working-directory: ./GUI + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + + - name: Setup Flutter ${{ env.FLUTTER_VERSION }} + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + + - name: Flet Build Windows + working-directory: ./GUI + run: | + flutter config --no-analytics + flet pack main.py --verbose + + - name: Copy assets + working-directory: ./GUI + run: cp -r ./assets ./dist/assets + + - name: Upload Windows Artifact + uses: actions/upload-artifact@v4.3.4 + with: + name: windows-build-artifact + path: ./GUI/dist + if-no-files-found: error + overwrite: false