Merge pull request #19 from Danaozhong/tas/fix-issues-on-older-qgis-v… #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build the QGIS plugin (Windows) | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
qgis_version: [3_34_0, 3_36_3, 3_38_0, 3_38_3, 3_40_0] | |
env: | |
EXT_OSGEO4W_ROOT: "C:/OSGeo4W" | |
Qt5_DIR: "C:/OSGeo4W/apps/Qt5" | |
steps: | |
- uses: actions/checkout@v4 | |
- run: mkdir $env:EXT_OSGEO4W_ROOT | out-null | |
- name: Install OSGeo4W | |
run: | | |
$exe = 'osgeo4w-setup.exe' | |
$url = 'http://download.osgeo.org/osgeo4w/v2/' + $exe | |
(New-Object System.Net.WebClient).DownloadFile($url, $exe) | |
Start-Process ('.\'+$exe) -ArgumentList '--advanced --autoaccept --quiet-mode --only-site -s http://download.osgeo.org/osgeo4w/v2/ -P qt5-devel,qt5-libs,qt5-tools,qt5-libs-symbols' -Wait -NoNewWindow | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Add Directories to PATH | |
run: | | |
Add-Content $env:GITHUB_PATH $env:EXT_OSGEO4W_ROOT/bin | |
Add-Content $env:GITHUB_PATH $env:Qt5_DIR/bin | |
- name: Configure CMake | |
run: | | |
$Env:OSGEO4W_ROOT="${{ github.workspace }}/dependencies/qgis/windows_x86_64/${{ matrix.qgis_version }}/" | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} -S ${{ github.workspace }} | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: qgis-${{ matrix.qgis_version }}-plugin-windows | |
path: ${{ steps.strings.outputs.build-output-dir }}/**/helloworldplugin.dll |