Skip to content

Commit

Permalink
ubuntu workflow attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Aug 16, 2024
1 parent 5d4bb27 commit aa3a894
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/qt-linux-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on:
push:
branches:
- linux

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
5 changes: 3 additions & 2 deletions HeadsetControl-Qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit aa3a894

Please sign in to comment.