From 3e9fa0e155f75230a17e3bac4bb72a82a4013910 Mon Sep 17 00:00:00 2001 From: Remisa Yousefvand Date: Fri, 29 Nov 2024 00:12:50 +0330 Subject: [PATCH] release #36 --- .github/workflows/cmake-multi-platform.yml | 59 ++++++++++++---------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 2e8f7f7..03193b2 100755 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -37,47 +37,51 @@ jobs: sudo apt-get install -y ninja-build \ qt6-base-dev qt6-tools-dev qt6-tools-dev-tools \ qt6-l10n-tools libgl1-mesa-dev libglu1-mesa-dev rsync + shell: bash + - name: Configure CMake (Ubuntu) if: matrix.os == 'ubuntu-latest' run: | - cmake -B "${{ github.workspace }}/build" \ - -DCMAKE_BUILD_TYPE=Release \ - -G "Ninja" \ - -S "${{ github.workspace }}" + cmake -B build -DCMAKE_BUILD_TYPE=Release -G "Ninja" -S . + shell: bash + - name: Build application (Ubuntu) if: matrix.os == 'ubuntu-latest' - run: cmake --build "${{ github.workspace }}/build" --config Release + run: cmake --build build --config Release + shell: bash + - name: Package application (Ubuntu) if: matrix.os == 'ubuntu-latest' run: | - BUILD_DIR="${{ github.workspace }}/build" - TEMP_DIR="/tmp/build_copy" - rm -rf $TEMP_DIR - rsync -a "$BUILD_DIR/" "$TEMP_DIR/" - cd $TEMP_DIR - tar -czvf application.tar.gz ./* + cd build + tar -czvf application.tar.gz . + shell: bash # macOS Section - name: Install dependencies (macOS) if: matrix.os == 'macos-latest' run: | brew install ninja qt + shell: bash + - name: Configure CMake (macOS) if: matrix.os == 'macos-latest' run: | - cmake -B "${{ github.workspace }}/build" \ - -DCMAKE_BUILD_TYPE=Release \ - -G "Ninja" \ - -S "${{ github.workspace }}" + cmake -B build -DCMAKE_BUILD_TYPE=Release -G "Ninja" -S . + shell: bash + - name: Build application (macOS) if: matrix.os == 'macos-latest' - run: cmake --build "${{ github.workspace }}/build" --config Release + run: cmake --build build --config Release + shell: bash + - name: Package application (macOS) if: matrix.os == 'macos-latest' run: | - cd "${{ github.workspace }}/build" + cd build hdiutil create -volname Application -srcfolder . -ov -format UDZO application.dmg zip application.zip application.dmg + shell: bash # Windows Section - name: Install dependencies (Windows) @@ -89,37 +93,42 @@ jobs: choco install ninja -y choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y shell: cmd - - name: Verify Visual Studio Installation + + - name: Verify Visual Studio Build Tools if: matrix.os == 'windows-latest' run: | $vcvarsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" if (!(Test-Path $vcvarsPath)) { - Write-Output "Visual Studio Build Tools not found at $vcvarsPath. Attempting installation again." + Write-Output "Visual Studio Build Tools not found at $vcvarsPath. Installation failed or incorrect path." + Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter vcvars64.bat exit 1 } else { Write-Output "Found Visual Studio Build Tools at $vcvarsPath" } shell: pwsh + - name: Configure CMake (Windows) if: matrix.os == 'windows-latest' run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && ^ - cmake -B D:\a\Notepad--\Notepad--\build ^ + cmake -B build ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_PREFIX_PATH="C:\Qt\6.5.3\msvc2019_64\lib\cmake" ^ -G Ninja ^ - -S D:\a\Notepad--\Notepad-- + -S . shell: cmd + - name: Build application (Windows) if: matrix.os == 'windows-latest' run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && ^ - cmake --build D:\a\Notepad--\Notepad--\build --config Release + cmake --build build --config Release shell: cmd + - name: Package application (Windows) if: matrix.os == 'windows-latest' run: | - cd D:\a\Notepad--\Notepad--\build + cd build Compress-Archive -Path . -DestinationPath application.zip shell: cmd @@ -128,6 +137,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: application-${{ matrix.os }} - path: | - ${{ github.workspace }}/build/application.${{ matrix.artifact_extension }} - /tmp/build_copy/application.tar.gz + path: build/application.${{ matrix.artifact_extension }}