From 409db694d32ae0edc8059f74de5d660549c7f517 Mon Sep 17 00:00:00 2001 From: Schildkroet Date: Wed, 6 Mar 2024 11:58:53 +0100 Subject: [PATCH] Create build_win.yml --- .github/workflows/build_win.yml | 84 +++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/build_win.yml diff --git a/.github/workflows/build_win.yml b/.github/workflows/build_win.yml new file mode 100644 index 0000000..b30c0cc --- /dev/null +++ b/.github/workflows/build_win.yml @@ -0,0 +1,84 @@ +name: Candle2 build_win + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +defaults: + run: + shell: cmd + +env: + SOURCE_DIR: ${{ github.workspace }} + QT_VERSION: 5.15.2 + ARTIFACT: qt-planets-build.zip + +jobs: + build: + runs-on: windows-2022 + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Get all tags for correct version determination + working-directory: ${{ github.workspace }} + run: | + git fetch --all --tags -f + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{ env.QT_VERSION }} + host: windows + target: desktop + arch: win64_msvc2019_64 + dir: ${{ runner.temp }} + modules: qtserialport + setup-python: false + + - name: Download JOM + uses: suisei-cn/actions-download-file@v1 + with: + url: http://download.qt.io/official_releases/jom/jom.zip + target: ${{ runner.temp }}\ + + - name: Unzip JOM + working-directory: ${{ runner.temp }} + run: | + 7z x jom.zip -ojom + + - name: Create build directory + run: mkdir ${{ runner.temp }}\build + + - name: Set up Visual Studio shell + uses: egor-tensin/vs-shell@v3 + with: + arch: x64 + + - name: Build + working-directory: ${{ runner.temp }}\build + run: | + qmake -r ${{ env.SOURCE_DIR }}\src\candle2.pro + ${{ runner.temp }}\jom\jom -j2 + cd release + windeployqt --qmldir ${{ env.SOURCE_DIR }} Candle2.exe --pdb --release --compiler-runtime + copy C:\Windows\System32\concrt140.dll . + copy C:\Windows\System32\vccorlib140.dll . + copy C:\Windows\System32\msvcp140.dll . + copy C:\Windows\System32\vcruntime140.dll . + + - name: Zip build + working-directory: ${{ runner.temp }} + run: | + 7z a candle2-build.zip ${{ runner.temp }}\build\* -r + + - name: Save build artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.ARTIFACT }} + path: ${{ runner.temp }}\${{ env.ARTIFACT }} +