From 96060cb37eaf6af90d9394f99e958515fe3cfd46 Mon Sep 17 00:00:00 2001 From: "Amir Y. Perehodnik" Date: Wed, 14 Aug 2024 22:03:37 +0300 Subject: [PATCH] Add pyinstaller building workflows --- .github/workflows/build-linux.yml | 45 +++++++++++++++++++++++++++++ .github/workflows/build-windows.yml | 45 +++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/build-linux.yml create mode 100644 .github/workflows/build-windows.yml diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 0000000..322df21 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,45 @@ +name: Build and Release for Linux + +on: + release: + types: [created] # Triggers only when a release is created + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Create Executable + uses: Martin005/pyinstaller-action@v1.2.0 + with: + python_ver: '3.10' + spec: 'pyinst-compile.spec' + requirements: 'requirements.txt' + upload_exe_with_name: 'arnis' + options: '--onefile --name arnis' + + - name: Build + run: make build + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist/arnis + asset_name: arnis + asset_content_type: application/octet-stream diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 0000000..55b0231 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,45 @@ +name: Build and Release for Windows + +on: + release: + types: [created] # Triggers only when a release is created + +jobs: + build-and-release: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Create Executable + uses: Martin005/pyinstaller-action@v1.2.0 + with: + python_ver: '3.10' + spec: 'pyinst-compile.spec' + requirements: 'requirements.txt' + upload_exe_with_name: 'arnis.exe' + options: '--onefile --name arnis' + + - name: Build + run: make build + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist/arnis.exe + asset_name: arnis.exe + asset_content_type: application/octet-stream