diff --git a/.github/workflows/qt-linux-build.yml b/.github/workflows/qt-linux-build.yml new file mode 100644 index 0000000..85b6030 --- /dev/null +++ b/.github/workflows/qt-linux-build.yml @@ -0,0 +1,58 @@ +name: Build + +on: + push: + branches: + - linux + +jobs: + linux-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: '6.7.2' + host: 'linux' + add-tools-to-path: true + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential libgl1-mesa-dev + + - name: Build with qmake + run: | + mkdir build + cd build + qmake ../HeadsetControl-Qt.pro CONFIG+=release + make -j$(nproc) + + - name: Remove source and object files + run: | + # Define the directory + buildDir="build/release" + + # Check if the directory exists + if [ -d "$buildDir" ]; then + # Remove .cpp, .h, .o files + find "$buildDir" -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.o" \) -exec rm -f {} + + else + echo "Directory not found: $buildDir" + fi + + - name: Zip binaries folder + run: | + zipFile="build/HeadsetControl-Qt_linux_64.zip" + folder="build/release" + zip -r "$zipFile" "$folder" + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: HeadsetControl-Qt_linux_64 + path: build/HeadsetControl-Qt_linux_64.zip \ No newline at end of file diff --git a/HeadsetControl-Qt.pro b/HeadsetControl-Qt.pro index 238cdd7..9dfd904 100644 --- a/HeadsetControl-Qt.pro +++ b/HeadsetControl-Qt.pro @@ -50,6 +50,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin DEPENDENCIES_DIR = $$PWD/src/dependencies DEST_DIR = $$OUT_PWD/release/dependencies -QMAKE_POST_LINK += powershell -Command "New-Item -ItemType Directory -Path '$$DEST_DIR' -Force; Copy-Item -Path '$$DEPENDENCIES_DIR\*' -Destination '$$DEST_DIR' -Recurse -Force" -#mkdir $$DEST_DIR +win32 { + QMAKE_POST_LINK += powershell -Command "New-Item -ItemType Directory -Path '$$DEST_DIR' -Force; Copy-Item -Path '$$DEPENDENCIES_DIR\*' -Destination '$$DEST_DIR' -Recurse -Force" +}