diff --git a/.github/scripts/prepareCMD.sh b/.github/scripts/prepareCMD.sh new file mode 100644 index 0000000..9742c35 --- /dev/null +++ b/.github/scripts/prepareCMD.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +# create a vairable to hold a passed in argument +# this argument is the next release version +# this is passed in from the .releaserc file + +sudo apt-get install -y jq + +nextReleaseVersion=$1 +TARGET_KEY="version" + +# parse all letters a-z and A-Z and replace with nothing +# this will remove all letters from the version string +# this is to ensure that the version string is a valid semver + +# check if there is a letter in the version string +# if there is a letter, then remove it +# if there is no letter, then do nothing +if [[ $nextReleaseVersion =~ [a-zA-Z] ]]; then + nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/[a-zA-Z]//g') + + # check if there is a dash in the version string + # if there is a dash, then replace it with a dot + # if there is no dash, then do nothing + if [[ $nextReleaseVersion =~ "-" ]]; then + # parse all dashes and replace with dots + # this is to ensure that the version string is a valid semver + nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/-/./g') + + # remove everything after the third dot and the dot itself + # this is to ensure that the version string is a valid semver + nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/\.[0-9]*$//g') + # remove the last dot + nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/\.$//g') + fi +fi + +# print the next release version + +printf "[prepareCMD.sh]: Next version: ${nextReleaseVersion}\n" + +# This script is used to execute the prepareCMD.sh script on the remote host +printf "[prepareCMD.sh]: Executing prepareCMD.sh on remote host \n" + +#printf "Update the version in the Cargo.toml file \n" +# +#sed -i "s/version = \"[0-9\\.]*\"/version = \"${nextReleaseVersion}\"/g" ./GUI/ETVR/src-tauri/Cargo.toml + +# Install the dependencies for toml file +printf "[prepareCMD.sh]: Installing the dependencies for the toml file \n" + +pip3 install yq + +export PATH="~/.local/bin:$PATH" +source ~/.bashrc + +tmp=$(mktemp) +tomlq -t --arg version "$nextReleaseVersion" '.tool.poetry.version |= $version' ./pyproject.toml > "$tmp" && mv "$tmp" ./pyproject.toml -f + +# validate the Cargo.toml file +#printf "[prepareCMD.sh]: Validating the Cargo.toml file \n" +#cat ./GUI/ETVR/src-tauri/Cargo.toml + +printf "[prepareCMD.sh]: Done, continuing with release. \n" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..375ec22 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,130 @@ +name: App Builder +on: + workflow_dispatch: + push: + tags: + - "v*" + branches: + - main + - master + - HSF-and-new-algos-feature-branch + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +permissions: + contents: write + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + defaults: + run: + shell: bash + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + token: ${{ env.GITHUB_TOKEN }} + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.10.11 + - name: Setup Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Load cached wheels + id: cached-pip-wheels + uses: actions/cache@v3 + with: + path: ~/.cache + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install python dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install + + - name: Install Linux dependencies + if: ${{ matrix.os == 'ubuntu-latest'}} + run: sudo apt install build-essential curl wget libssl-dev + + - run: source $VENV + + - name: Build Backend + run: poetry run pyinstaller --noconfirm EyeTrackApp/eyetrackapp.spec EyeTrackApp/eyetrackapp.py + + - name: Rename Linux Binary + if: ${{ matrix.os == 'ubuntu-latest' }} + #mv ./dist/ETVR ./dist/ETVR.bin + run: | + ls -a dist + mv ./dist/eyetrackapp ./dist/eyetrackapp.bin + + - uses: actions/upload-artifact@v2 + with: + name: production-files + path: dist + deploy: + runs-on: ubuntu-latest + name: Deploy + needs: [build] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Create Directory + run: mkdir -p dist + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: production-files + path: ./dist + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm install -g conventional-changelog-conventionalcommits + - run: npm install -g semantic-release@v19.0.5 + - run: npm install -g @semantic-release/exec + - run: npm install -g @semantic-release/git + - run: npm install -g @semantic-release/release-notes-generator + - run: npm install -g @semantic-release/changelog + - run: npm install -g @semantic-release/github + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + chmod +x ./.github/scripts/prepareCMD.sh + semantic-release + cleanup: + name: Cleanup actions + needs: + - deploy + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: "♻️ remove build artifacts" + uses: geekyeggo/delete-artifact@v1 + with: + name: production-files \ No newline at end of file diff --git a/.github/workflows/build_all_the_things.txt b/.github/workflows/build_all_the_things.txt deleted file mode 100644 index 3303759..0000000 --- a/.github/workflows/build_all_the_things.txt +++ /dev/null @@ -1,92 +0,0 @@ -name: Tasmota CI - -on: - workflow_dispatch: - pull_request: - branches: development - paths: - - '**.c' - - '**.cpp' - - '**.h' - - '**.hpp' - - '**.ino' - - '**.json' - - '**.properties' - - 'pio-tools/*.py' - - '**.ini' - - '.github/workflows/build_all_the_things.yml' - -jobs: - base-images: - runs-on: ubuntu-latest - if: github.repository == 'arendst/Tasmota' - strategy: - matrix: - variant: - - tasmota - - tasmota4M - - tasmota-display - - tasmota-ir - - tasmota-knx - - tasmota-lite - - tasmota-minimal - - tasmota-sensors - - tasmota-zbbridge - - tasmota-zigbee - - tasmota32 - - tasmota32-webcam - - tasmota32-bluetooth - - tasmota32-core2 - - tasmota32-display - - tasmota32-ir - - tasmota32-lvgl - - tasmota32s2 - - tasmota32c3 - - tasmota32c3usb - - tasmota32solo1 - - tasmota32solo1-safeboot - - tasmota32-safeboot - - tasmota32c3-safeboot - - tasmota32c3usb-safeboot - - tasmota32s2-safeboot - - tasmota32s3-safeboot - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - #python -m pip install --upgrade pip - pip install -U platformio - #platformio upgrade --dev - #platformio update - - name: Run PlatformIO - run: platformio run -e ${{ matrix.variant }} - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - language-images: - runs-on: ubuntu-latest - if: github.repository == 'arendst/Tasmota' - strategy: - matrix: - variant: [ tasmota ] - language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - #python -m pip install --upgrade pip - pip install -U platformio - #platformio upgrade --dev - #platformio update - - name: Run PlatformIO - run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output diff --git a/.github/workflows/build_devel.txt b/.github/workflows/build_devel.txt deleted file mode 100644 index 3f9fe9e..0000000 --- a/.github/workflows/build_devel.txt +++ /dev/null @@ -1,162 +0,0 @@ -name: Build_development - -on: - workflow_dispatch: # Manually start a workflow - push: - branches: development - paths-ignore: - - '.github/**' # Ignore changes towards the .github directory - - '**.md' # Do no build if *.md files changes - -# Ensures that only one deploy task per branch/environment will run at a time. -concurrency: - group: environment-${{ github.ref }} - cancel-in-progress: true - -jobs: - base-images: - runs-on: ubuntu-latest - if: github.repository == 'arendst/Tasmota' - continue-on-error: true - strategy: - matrix: - variant: - - tasmota - - tasmota4M - - tasmota-minimal - - tasmota-display - - tasmota-ir - - tasmota-knx - - tasmota-lite - - tasmota-sensors - - tasmota-zbbridge - - tasmota-zigbee - - tasmota32 - - tasmota32-webcam - - tasmota32-bluetooth - - tasmota32-display - - tasmota32-ir - - tasmota32-lvgl - - tasmota32c3 - - tasmota32c3usb - - tasmota32solo1 - - tasmota32solo1-safeboot - - tasmota32-safeboot - - tasmota32c3-safeboot - - tasmota32c3usb-safeboot - - tasmota32s2-safeboot - - tasmota32s3-safeboot - steps: - - uses: actions/checkout@v3 - with: - ref: development - - name: Set up Python - uses: actions/setup-python@v2 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: platformio run -e ${{ matrix.variant }} - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - language-images: - runs-on: ubuntu-latest - if: github.repository == 'arendst/Tasmota' - continue-on-error: true - strategy: - matrix: - variant: [ tasmota, tasmota32 ] - language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] - steps: - - uses: actions/checkout@v3 - with: - ref: development - - name: Set up Python - uses: actions/setup-python@v2 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - Upload: - needs: [base-images, language-images] - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/download-artifact@v2 - with: - name: firmware - path: ./mv_firmware - - name: Display structure of downloaded files - run: ls -R - working-directory: ./mv_firmware - - name: Move firmware files in sub-folders - run: | - mkdir -p ./firmware/tasmota/languages - mkdir -p ./firmware/tasmota32/languages - mkdir -p ./firmware/map - [ ! -f ./mv_firmware/map/* ] || mv ./mv_firmware/map/* ./firmware/map/ - [ ! -f ./mv_firmware/firmware/tasmota.* ] || mv ./mv_firmware/firmware/tasmota.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota4M.* ] || mv ./mv_firmware/firmware/tasmota4M.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-sensors.* ] || mv ./mv_firmware/firmware/tasmota-sensors.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-minimal.bin.gz ] || mv ./mv_firmware/firmware/tasmota-minimal.bin.gz ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-lite.* ] || mv ./mv_firmware/firmware/tasmota-lite.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-ir*.* ] || mv ./mv_firmware/firmware/tasmota-ir*.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-display.* ] || mv ./mv_firmware/firmware/tasmota-display.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-knx.* ] || mv ./mv_firmware/firmware/tasmota-knx.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-zbbridge.* ] || mv ./mv_firmware/firmware/tasmota-zbbridge.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-zigbee.* ] || mv ./mv_firmware/firmware/tasmota-zigbee.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota32.* ] || mv ./mv_firmware/firmware/tasmota32.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32solo1*.* ] || mv ./mv_firmware/firmware/tasmota32solo1*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-ir*.* ] || mv ./mv_firmware/firmware/tasmota32-ir*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-display.* ] || mv ./mv_firmware/firmware/tasmota32-display.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-lvgl.* ] || mv ./mv_firmware/firmware/tasmota32-lvgl.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-web*.* ] || mv ./mv_firmware/firmware/tasmota32-web*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-odroidgo.* ] || mv ./mv_firmware/firmware/tasmota32-odroidgo.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-core2.* ] || mv ./mv_firmware/firmware/tasmota32-core2.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-bluetooth.* ] || mv ./mv_firmware/firmware/tasmota32-bluetooth.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32c3*.* ] || mv ./mv_firmware/firmware/tasmota32c3*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-safeboot* ] || mv ./mv_firmware/firmware/tasmota32-safeboot* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-* ] || mv ./mv_firmware/firmware/tasmota32-* ./firmware/tasmota32/languages/ - [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./firmware/tasmota/languages/ - - name: Display files to transfer - run: ls -R ./* - - name: Push Firmware files to tmp_copy repo - uses: Jason2866/copy_file_to_another_repo_action@main - env: - API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} - with: - source_file: 'firmware' - destination_repo: 'arendst/tmp_copy' - destination_branch: 'firmware' - user_email: 'github-actions@github.com' - user_name: 'github-actions' - - Start_final_copy: - needs: Upload - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Creat trigger.txt - run: | - echo ${GITHUB_SHA} &> trigger.txt - echo "$( trigger.txt - echo "$( All notable changes to this project will be documented in this file" + } + ], + [ + "@semantic-release/exec", + { + "prepareCmd": "./.github/scripts/prepareCMD.sh ${nextRelease.version}", + "publishCmd": "echo Publishing ${nextRelease.version}" + } + ], + [ + "@semantic-release/github", + { + "addReleases": "bottom", + "assets": [ + { + "path": "./dist/**/*.{msi,deb,rpm,AppImage,dmg,sha256sum,bin,exe}" + } + ] + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "LICENSE*", + "CHANGELOG.md" + ], + "message": "chore(${nextRelease.type}): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +} diff --git a/EyeTrackApp/eyetrackapp.spec b/EyeTrackApp/eyetrackapp.spec index ffa86b9..fb61b01 100644 --- a/EyeTrackApp/eyetrackapp.spec +++ b/EyeTrackApp/eyetrackapp.spec @@ -20,7 +20,10 @@ pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, - a.scripts, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, [], exclude_binaries=True, name='eyetrackapp', @@ -29,16 +32,11 @@ exe = EXE(pyz, strip=False, upx=True, console=True, + runtime_tmpdir=None, disable_windowed_traceback=False, + argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, icon="Images/logo.ico" ) -coll = COLLECT(exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='EyeTrackApp') +