From 2547e6bce269157705814eb68f8a7a41540cbfc3 Mon Sep 17 00:00:00 2001 From: Eriq Augustine Date: Tue, 25 Jun 2024 19:47:50 -0400 Subject: [PATCH] (wip) Working on CI. Merged workflows so we can use a matrix. --- .github/workflows/artifacts.yml | 62 --------------------------------- .github/workflows/main.yml | 28 ++++++++++++++- 2 files changed, 27 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/artifacts.yml diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml deleted file mode 100644 index abac20b..0000000 --- a/.github/workflows/artifacts.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "Build Latest Artifacts" - -# See: https://github.com/Nuitka/Nuitka?tab=readme-ov-file#use-case-7--building-with-github-workflows - -# Because of github limitations, this will only be triggered on the main branch. - -# TEST - limit to main - -on: - workflow_run: - workflows: - - Main - types: - - completed - branches: - - main - -jobs: - on-success: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - - runs-on: 'ubuntu-22.04' - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set Up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Cache Python Dependencies - uses: actions/cache@v4 - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-os:ubuntu-22.04-python:3.11-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }} - - - name: Install Python Dependencies - shell: bash - run: pip3 install -r requirements.txt -r requirements-dev.txt - - - name: Build Executable with Nuitka - uses: Nuitka/Nuitka-Action@main - with: - nuitka-version: main - script-name: main.py - standalone: true - onefile: true - include-data-dir: | - ./static=static - include-data-files: | - ./pyproject.toml=./ - - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ runner.os }} Build - path: | - build/*.exe - build/*.bin - build/*.app/**/* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5141813..4395654 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: python-version: ['3.11'] - os: ['ubuntu-22.04'] + os: ['ubuntu-22.04', 'macos-12', 'windows-2022'] runs-on: ${{ matrix.os }} @@ -36,3 +36,29 @@ jobs: - name: Check Python Version Compatibility shell: bash run: vermin --no-tips --no-parse-comments --target=3.8- --violations *.py + + # Create a release for this OS (but only on a single version of Python). + # See: https://github.com/Nuitka/Nuitka?tab=readme-ov-file#use-case-7--building-with-github-workflows + + - name: Build ${{ runner.os }} Release Executable with Nuitka + if: matrix.python-version == '3.11' + uses: Nuitka/Nuitka-Action@main + with: + nuitka-version: main + script-name: main.py + standalone: true + onefile: true + include-data-dir: | + ./static=static + include-data-files: | + ./pyproject.toml=./ + + - name: Upload Artifacts + if: matrix.python-version == '3.11' + uses: actions/upload-artifact@v3 + with: + name: ${{ runner.os }} Build + path: | + build/*.exe + build/*.bin + build/*.app/**/*