|
| 1 | +name: Windows build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: '*' |
| 6 | + tags: '*' |
| 7 | + pull_request: |
| 8 | + branches: [ "master" ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: windows-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + qt-version: ['6.6'] |
| 16 | + qt-target: ['desktop'] |
| 17 | + qt-modules: [''] |
| 18 | + mingw-version: ['11.2.0'] |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v3 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + submodules: 'recursive' |
| 24 | + - name: Setup environment |
| 25 | + run: | |
| 26 | + sed -i -e '/^#/d' .github/config.env |
| 27 | + sed -i -e '/^$/d' .github/config.env |
| 28 | + cat .github/config.env >> "${GITHUB_ENV}" |
| 29 | + shell: bash |
| 30 | + - name: Get version |
| 31 | + run: | |
| 32 | + version=$(LC_ALL=en_US.utf8 grep -oP 'project\([^)]*\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt) |
| 33 | + echo "Project version: $version" |
| 34 | + echo previous_tag=$version >> "${GITHUB_ENV}" |
| 35 | + shell: bash |
| 36 | + ## Install Qt |
| 37 | + - name: Install Qt |
| 38 | + uses: jurplel/install-qt-action@v3 |
| 39 | + with: |
| 40 | + version: ${{ matrix.qt-version }} |
| 41 | + host: 'windows' |
| 42 | + arch: 'win64_mingw' |
| 43 | + target: ${{ matrix.qt-target }} |
| 44 | + modules: ${{ matrix.qt-modules }} |
| 45 | + - name: Install Qt IFW |
| 46 | + run: | |
| 47 | + curl -o aqt.exe -L https://github.com/miurahr/aqtinstall/releases/download/v2.2.1/aqt.exe |
| 48 | + ./aqt.exe install-tool windows desktop tools_ifw |
| 49 | + mv Tools .. |
| 50 | + echo ${pwd}/../Tools/QtInstallerFramework/*/bin >> "${GITHUB_PATH}" |
| 51 | + shell: bash |
| 52 | + - name: Install MinGW |
| 53 | + uses: egor-tensin/setup-mingw@v2 |
| 54 | + with: |
| 55 | + platform: x64 |
| 56 | + static: 0 |
| 57 | + version: ${{ matrix.mingw-version }} |
| 58 | + ## Build |
| 59 | + #- name: Build |
| 60 | + # run: .ci/windows_build.sh |
| 61 | + # shell: bash |
| 62 | + - name: Windows build |
| 63 | + run: .ci/common/build.sh win_build win64 |
| 64 | + shell: bash |
| 65 | + - name: Copy files |
| 66 | + run: | |
| 67 | + mkdir win_release |
| 68 | + robocopy win_build release *.exe /S /MOV |
| 69 | + robocopy win_build release *.dll /S /MOV |
| 70 | + cd win_release |
| 71 | + windeployqt ${{ env.executable_name }}.exe --qmldir ..\win_build\src || exit 5 |
| 72 | + for %%v in (*.dll) do windeployqt "%%v" || exit 5 |
| 73 | + shell: cmd |
| 74 | + #- name: Finalize Windows build |
| 75 | + # run: .ci/windows_build.sh 1 |
| 76 | + # shell: bash |
| 77 | + ## Upload |
| 78 | + - name: Upload artifacts |
| 79 | + uses: actions/upload-artifact@v3 |
| 80 | + with: |
| 81 | + name: build-Qt-${{ matrix.qt-version }} |
| 82 | + path: win_release/ |
| 83 | + ## Build installer |
| 84 | + #- if: env.create_windows_installer == 1 |
| 85 | + # name: Disable repository update |
| 86 | + # run: | |
| 87 | + # echo "update_windows_installer=0" >> "${GITHUB_ENV}" |
| 88 | + # echo "update_windows_repository=0" >> "${GITHUB_ENV}" |
| 89 | + # shell: bash |
| 90 | + #- if: env.create_windows_installer == 1 |
| 91 | + # name: Build installer |
| 92 | + # run: .ci/windows-repo.sh |
| 93 | + # shell: bash |
| 94 | + ## Upload installer |
| 95 | + #- name: Upload installer |
| 96 | + # uses: actions/upload-artifact@v3 |
| 97 | + # with: |
| 98 | + # name: installer-Qt-${{ matrix.qt-version }} |
| 99 | + # path: '*.exe' |
0 commit comments