diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 8e08ce865c..89b899c5a3 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -9,5 +9,5 @@ jobs: commitlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: wagoid/commitlint-github-action@v5 diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 5603c5ffa2..25d2506003 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -15,9 +15,9 @@ jobs: steps: - name: Checkout github repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -37,7 +37,7 @@ jobs: node-version: [18.16.1] steps: - name: Checkout github repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 50e9abf4fe..a5980f135f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,3 @@ -#file: noinspection YAMLSchemaValidation name: deploy on: push: @@ -16,7 +15,7 @@ jobs: steps: - name: 🐙 Checkout GitHub repo (+ download lfs dependencies) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -40,7 +39,7 @@ jobs: NODE_OPTIONS: --max-old-space-size=8192 - name: 🐍 Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.8 @@ -78,7 +77,7 @@ jobs: working-directory: dist/package - name: 🚀 Upload binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: AntaresWeb-${{ matrix.os }}-pkg path: dist/package/AntaresWeb.zip diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe19702948..90c818eacc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,9 +9,9 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout github repo (+ download lfs dependencies) - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install dependencies @@ -42,9 +42,9 @@ jobs: steps: - name: Checkout github repo (+ download lfs dependencies) - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install dependencies @@ -60,7 +60,7 @@ jobs: sed -i 's/\/home\/runner\/work\/AntaREST\/AntaREST/\/github\/workspace/g' coverage.xml - name: Archive code coverage results if: matrix.os == 'ubuntu-20.04' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: python-code-coverage-report path: coverage.xml @@ -72,7 +72,7 @@ jobs: os: [ ubuntu-20.04 ] steps: - name: Checkout github repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: @@ -94,7 +94,7 @@ jobs: runs-on: ubuntu-20.04 needs: [ python-test, npm-test ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download python coverage report uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/worker.yml b/.github/workflows/worker.yml new file mode 100644 index 0000000000..4839670d62 --- /dev/null +++ b/.github/workflows/worker.yml @@ -0,0 +1,37 @@ +name: worker +on: + push: + branches: + - "master" + - "worker/**" + +jobs: + binary: + runs-on: windows-latest + + steps: + - name: 🐙 Checkout GitHub repo (+ download lfs dependencies) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🐍 Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + + - name: 🐍 Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller==5.6.2 + + - name: 📦 Packaging AntaresWebWorker + run: bash ./package_worker.sh + working-directory: scripts + + - name: 🚀 Upload binary + uses: actions/upload-artifact@v4 + with: + name: AntaresWebWorker + path: dist/AntaresWebWorker.exe diff --git a/AntaresWebWorker.spec b/AntaresWebWorker.spec new file mode 100644 index 0000000000..8eeb1c1988 --- /dev/null +++ b/AntaresWebWorker.spec @@ -0,0 +1,45 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + +a = Analysis( + ["antarest/worker/archive_worker_service.py"], + pathex=[], + binaries=[], + datas=[("resources", "resources")], + hiddenimports=["pythonjsonlogger.jsonlogger"], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +pyz = PYZ( + a.pure, + a.zipped_data, + cipher=block_cipher, +) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name="AntaresWebWorker", + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) \ No newline at end of file diff --git a/scripts/package_antares_web.sh b/scripts/package_antares_web.sh index 98d9bc2db7..9a0efb5e15 100755 --- a/scripts/package_antares_web.sh +++ b/scripts/package_antares_web.sh @@ -3,7 +3,7 @@ # Antares Web Packaging -- Desktop Version # # This script is launch by the GitHub Workflow `.github/workflows/deploy.yml`. -# It builds the Desktop version of the Web Application and the Worker Application. +# It builds the Desktop version of the Web Application. # Make sure you run the `npm install` stage before running this script. set -e diff --git a/scripts/package_worker.sh b/scripts/package_worker.sh new file mode 100644 index 0000000000..686d131621 --- /dev/null +++ b/scripts/package_worker.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# AntaresWebWorker packaging +# +# This script is launch by the GitHub Workflow `.github/workflows/worker.yml`. +# It builds the AntaresWebWorker. + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) +PROJECT_DIR=$(dirname -- "${SCRIPT_DIR}") +DIST_DIR="${PROJECT_DIR}/dist" + +echo "INFO: Generating the Worker Application..." +pushd ${PROJECT_DIR} +pyinstaller --distpath ${DIST_DIR} AntaresWebWorker.spec +popd + +chmod +x "${DIST_DIR}/AntaresWebWorker"