Skip to content

Commit

Permalink
workflow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Aug 16, 2024
1 parent 3df6394 commit 2de04cb
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

jobs:
build:
windows-build:
runs-on: windows-latest

steps:
Expand Down Expand Up @@ -50,36 +50,24 @@ jobs:
mkdir build
cd build
qmake ..\HeadsetControl-Qt.pro CONFIG+=release
# Use the JOM path variable
$jomPath = "${{ steps.jom-setup.outputs.jom_path }}"
& "$jomPath\jom.exe"
- name: Remove source and object files
shell: pwsh
run: |
# Define the directory
$buildDir = "build/release"
# Check if the directory exists
if (Test-Path $buildDir) {
# Remove .cpp, .h, .obj, and .res files
Get-ChildItem -Path $buildDir -Include *.cpp, *.h, *.obj, *.res -Recurse | Remove-Item -Force
} else {
Write-Host "Directory not found: $buildDir"
}
- name: Deploy Qt
shell: pwsh
run: |
# Navigate to the directory containing the executable
cd build
# Use the found path to windeployqt
$windeployqtPath = "D:\a\HeadsetControl-Qt\Qt\6.7.2\msvc2019_64\bin\windeployqt6.exe"
# Check if the executable exists
if (Test-Path $windeployqtPath) {
# Run windeployqt with the updated options
& $windeployqtPath `
--exclude-plugins qmodernwindowsstyle,qsvgicon,qsvg,qico,qjpeg,qgif,qnetworklistmanager,qtuiotouchplugin `
--no-opengl-sw `
Expand All @@ -91,7 +79,6 @@ jobs:
} else {
Write-Error "windeployqt not found at the expected path!"
exit 1
}
- name: Rename release folder
shell: pwsh
Expand All @@ -103,36 +90,73 @@ jobs:
} else {
Write-Error "Release folder not found!"
exit 1
}
- name: Zip binaries folder
shell: pwsh
run: |
$zipFile = "build/HeadsetControl-Qt_msvc_64.zip"
$folder = "build/HeadsetControl-Qt"
Compress-Archive -Path $folder -DestinationPath $zipFile
shell: pwsh

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: HeadsetControl-Qt_msvc_64
path: build/HeadsetControl-Qt_msvc_64.zip

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.4.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: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: HeadsetControl-Qt_linux_64
path: build/HeadsetControl-Qt

release:
runs-on: ubuntu-latest
needs: build
needs: [windows-build, linux-build]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifact zip
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: HeadsetControl-Qt_msvc_64

- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: HeadsetControl-Qt_linux_64

- name: List files in current directory
run: ls -la

- name: Bump version and create release
id: bump_release
run: |
Expand Down Expand Up @@ -170,7 +194,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload release assets
- name: Upload Windows release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
Expand All @@ -179,3 +203,13 @@ jobs:
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Linux release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: HeadsetControl-Qt_linux_64
asset_name: HeadsetControl-Qt_linux_64
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build
on:
push:
branches:
- linux
- main

jobs:
Expand Down Expand Up @@ -120,3 +119,35 @@ jobs:
with:
name: HeadsetControl-Qt_msvc_64
path: build/HeadsetControl-Qt_msvc_64.zip

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.4.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: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: HeadsetControl-Qt_linux_64
path: build/HeadsetControl-Qt
42 changes: 0 additions & 42 deletions .github/workflows/qt-linux-build.yml

This file was deleted.

0 comments on commit 2de04cb

Please sign in to comment.