From a78cc1c3b2f4a4e2561a8c0551053b4a08e221f6 Mon Sep 17 00:00:00 2001 From: Xevion Date: Fri, 22 Sep 2023 20:35:30 -0500 Subject: [PATCH] Add windows build (first iteration), rename linux build workflow file --- .../{build.yaml => build-linux.yaml} | 0 .github/workflows/build-windows.yaml | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+) rename .github/workflows/{build.yaml => build-linux.yaml} (100%) create mode 100644 .github/workflows/build-windows.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build-linux.yaml similarity index 100% rename from .github/workflows/build.yaml rename to .github/workflows/build-linux.yaml diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml new file mode 100644 index 0000000..ed0c4b5 --- /dev/null +++ b/.github/workflows/build-windows.yaml @@ -0,0 +1,57 @@ +name: Build for Windows +on: + push: + branches: [master] + pull_request: + branches: [master] + +env: + BUILD_TYPE: Release + +jobs: + buildWindows: + runs-on: windows-latest + + steps: + - name: Setup Microsoft Visual C++ + uses: ilammy/msvc-dev-cmd@v1 + + - name: Install Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: "6.5.2" + host: "windows" + target: "desktop" + arch: "win64_msvc2019_64" + install-deps: "true" + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build for Windows + shell: bash + run: | + cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -B '${{github.workspace}}'/build + cmake --build . + + - name: Package Executables with windeployqt + shell: bash + run: | + VERSION=0.0.1-win + APPNAME=TestTaker-${VERSION}-win-x86_64.zip + echo "APPNAME=${APPNAME}" >> $GITHUB_ENV + + mkdir packageDir + pushd packageDir + mv ../TestTaker.exe . + + windeployqt.exe -svg --release --no-compiler-runtime --no-opengl-sw --no-translations TestTaker.exe + 7z a -r ../${APPNAME} * + + - uses: actions/upload-artifact@v2 + with: + name: testtaker-windows + path: ${{ env.APPNAME }}