diff --git a/.github/workflows/build-multi-os.yml b/.github/workflows/build-multi-os.yml index 396dbcad..c3bac9b5 100644 --- a/.github/workflows/build-multi-os.yml +++ b/.github/workflows/build-multi-os.yml @@ -16,8 +16,7 @@ name: Build on: push: tags: - - 'v*' - - 'test*' + - '[0-9]+.[0-9]+.[0-9]+-?[a-zA-Z0-9]*' jobs: setup: @@ -36,6 +35,7 @@ jobs: run: | echo "sha-short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT + echo "truncated-tag=$(git describe --tags | sed -e 's/-.*$//')" >> $GITHUB_OUTPUT echo "draft=$(git describe --tags | sed -e 's/^test.*/true/;s/^v.*/false/')" >> $GITHUB_OUTPUT echo "manifest=$(cat src/main/resources/base/ayab/firmware/manifest.txt)" >> $GITHUB_OUTPUT - name: Get firmware version matching manifest @@ -61,8 +61,8 @@ jobs: - name: Set PACKAGE_VERSION run: | echo ${{ steps.vars.outputs.tag }} > src/main/resources/base/ayab/package_version - sed -i 's/PACKAGE_VERSION/${{steps.vars.outputs.tag}}/' src/build/settings/base.json - cat src/main/resources/base/ayab/package_version + sed -i -e 's/PACKAGE_VERSION/${{steps.vars.outputs.truncated-tag}}/' src/build/settings/base.json + cat src/build/settings/base.json - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -185,14 +185,15 @@ jobs: run: | echo "sha-short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT + echo "truncated-tag=$(git describe --tags | sed -e 's/-.*$//')" >> $GITHUB_OUTPUT echo "draft=$(git describe --tags | sed -e 's/^test.*/true/;s/^v.*/false/')" >> $GITHUB_OUTPUT echo "manifest=$(cat src/main/resources/base/ayab/firmware/manifest.txt)" >> $GITHUB_OUTPUT - name: Set PACKAGE_VERSION shell: bash run: | echo ${{steps.vars.outputs.tag}} > src/main/resources/base/ayab/package_version - sed -i 's/PACKAGE_VERSION/${{steps.vars.outputs.tag}}/' src/build/settings/base.json - cat src/main/resources/base/ayab/package_version + sed -i -e 's/PACKAGE_VERSION/${{steps.vars.outputs.truncated-tag}}/' src/build/settings/base.json + cat src/build/settings/base.json - name: Set up Python ${{ matrix.python-version }} id: py uses: actions/setup-python@v4 @@ -269,16 +270,6 @@ jobs: pwd ls -l src/main/python/ayab/ ls -l src/main/resources/base/ayab/translations/ - - name: Patch fbs package - shell: pwsh - run: | - $cwd = $(Get-Location).Path - $path = '${{ steps.py.outputs.python-path }}' -Replace '[^\\]*$', '' - echo $path - $fbs = $(Get-ChildItem -Path $path -Depth 3 -Filter 'fbs')[0].FullName + '\..\' - echo $fbs - Set-Location $fbs - patch -u -i $($cwd + '\windows-build\patch-fbs.diff') 'fbs/_defaults/src/installer/windows/Installer.nsi' - name: Build app shell: pwsh run: python -m fbs freeze --debug @@ -320,15 +311,17 @@ jobs: submodules: recursive - name: Set variables id: vars + shell: bash run: | echo "sha-short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT + echo "truncated-tag=$(git describe --tags | sed -e 's/-.*$//')" >> $GITHUB_OUTPUT echo "manifest=$(cat src/main/resources/base/ayab/firmware/manifest.txt)" >> $GITHUB_OUTPUT - name: Set PACKAGE_VERSION run: | echo ${{steps.vars.outputs.tag}} > src/main/resources/base/ayab/package_version - sed -i'' -e 's/PACKAGE_VERSION/${{steps.vars.outputs.tag}}/' src/build/settings/base.json - cat src/main/resources/base/ayab/package_version + sed -i -e 's/PACKAGE_VERSION/${{steps.vars.outputs.truncated-tag}}/' src/build/settings/base.json + cat src/build/settings/base.json - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -429,6 +422,7 @@ jobs: cd git echo "sha-short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT + echo "truncated-tag=$(git describe --tags | sed -e 's/-.*$//')" >> $GITHUB_OUTPUT echo "python=python${{matrix.python-version}}" >> $GITHUB_OUTPUT echo "manifest=$(cat src/main/resources/base/ayab/firmware/manifest.txt)" >> $GITHUB_OUTPUT echo "python-appimage=python${{matrix.python-version}}.15-cp36-cp36m-manylinux2014_x86_64.AppImage" >> $GITHUB_OUTPUT @@ -436,8 +430,8 @@ jobs: run: | cd git echo ${{steps.vars.outputs.tag}} > src/main/resources/base/ayab/package_version - sed -i 's/PACKAGE_VERSION/${{steps.vars.outputs.tag}}/' src/build/settings/base.json - cat src/main/resources/base/ayab/package_version + sed -i -e 's/PACKAGE_VERSION/${{steps.vars.outputs.truncated-tag}}/' src/build/settings/base.json + cat src/build/settings/base.json - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/README.md b/README.md index 74f196f4..f48a3484 100644 --- a/README.md +++ b/README.md @@ -102,13 +102,6 @@ Then convert the PyQt5 `.ui` files and generate the translation files: .\setup-environment.ps1 -Finally, the `fbs` module needs a small patch. - - conda install -c free patch - $dir = $(pwd).Path - cd $Env:CONDA_PREFIX\Lib\site-packages\fbs\ - patch -u -i $dir\windows-build\patch-fbs.diff _defaults\src\installer\windows\Installer.nsi - Now start AYAB with: fbs run diff --git a/requirements.txt b/requirements.txt index f240cc28..8ae76298 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -fbs==0.8.6 +fbs==1.0 PyInstaller==3.4 pyqt5==5.9.2 Pillow==7.1.2 diff --git a/windows-build/patch-fbs.diff b/windows-build/patch-fbs.diff deleted file mode 100644 index f4b58850..00000000 --- a/windows-build/patch-fbs.diff +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/fbs/_defaults/src/installer/windows/Installer.nsi b/fbs/_defaults/src/installer/windows/Installer.nsi -old mode 100644 -new mode 100755 -index 47dfb0f..a18ea8c ---- a/fbs/_defaults/src/installer/windows/Installer.nsi -+++ b/fbs/_defaults/src/installer/windows/Installer.nsi -@@ -49,7 +49,7 @@ FunctionEnd - !define MUI_FINISHPAGE_RUN - !define MUI_FINISHPAGE_RUN_CHECKED - !define MUI_FINISHPAGE_RUN_TEXT "Run ${app_name}" -- !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink" -+ !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchAsNonAdmin" - !insertmacro MUI_PAGE_FINISH - - !insertmacro MUI_UNPAGE_CONFIRM -@@ -95,7 +95,7 @@ Section "Uninstall" - - SectionEnd - --Function LaunchLink -- !addplugindir "." -- ShellExecAsUser::ShellExecAsUser "open" "$SMPROGRAMS\${app_name}.lnk" --FunctionEnd -\ No newline at end of file -+Function LaunchAsNonAdmin -+ Exec '"$WINDIR\explorer.exe" "$InstDir\${app_name}.exe"' -+FunctionEnd -+