build-on-windows #58
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-on-windows | |
on: | |
workflow_dispatch: | |
env: | |
LR: release-3_12 | |
LTR: release-3_10 | |
jobs: | |
OSGeo4W: | |
strategy: | |
max-parallel: 4 | |
runs-on: windows-2019 | |
timeout-minutes: 360 | |
env: | |
OSGEO4W_ROOT: C:\OSGeo4W64 | |
OSGEO4W_ARCH: x86_64 | |
CLCACHE_DIR: c:\clcache-x86_64 | |
PLATFORM: x64 | |
steps: | |
- name: Checkout QGIS repo | |
uses: actions/checkout@v4 | |
with: | |
repository: qgis/QGIS | |
- name: Setup build variables | |
run: | | |
branch=${{ github.ref_name }} | |
BUILD_SOURCEVERSION=${{ github.sha }} | |
echo "BRANCH: ${branch}" | |
echo "BUILD_SOURCEVERSION: ${BUILD_SOURCEVERSION}" | |
echo "LR: ${LR}" | |
echo "LTR: ${LTR}" | |
case "${branch}" in | |
"${LTR}") | |
OSGEO4W_PKG=qgis-ltr-dev | |
OSGEO4W_DEPS=qgis-ltr-dev-deps | |
;; | |
"${LR}") | |
OSGEO4W_PKG=qgis-rel-dev | |
OSGEO4W_DEPS=qgis-rel-dev-deps | |
;; | |
*) | |
OSGEO4W_PKG=qgis-dev | |
OSGEO4W_DEPS=qgis-dev-deps | |
;; | |
esac | |
target=Experimental | |
major=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MAJOR "\([0-9]*\)")\s*$/\1/ip' CMakeLists.txt) | |
minor=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MINOR "\([0-9]*\)")\s*$/\1/ip' CMakeLists.txt) | |
patch=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_PATCH "\([0-9]*\)")\s*$/\1/ip' CMakeLists.txt) | |
binary=${{ github.run_number }} | |
version=$major.$minor.$patch | |
sha="${BUILD_SOURCEVERSION:0:10}" | |
buildname="$OSGEO4W_PKG-$version-$sha-$target-VC14-$OSGEO4W_ARCH" | |
echo "TARGET=$target" >> ${GITHUB_ENV} | |
echo "OSGEO4W_PKG=$OSGEO4W_PKG" >> ${GITHUB_ENV} | |
echo "OSGEO4W_DEPS=$OSGEO4W_DEPS" >> ${GITHUB_ENV} | |
echo "MAJOR=$major" >> ${GITHUB_ENV} | |
echo "MINOR=$minor" >> ${GITHUB_ENV} | |
echo "PATCH=$patch" >> ${GITHUB_ENV} | |
echo "BINARY=$binary" >> ${GITHUB_ENV} | |
echo "VERSION=$version" >> ${GITHUB_ENV} | |
echo "BUILDNAME=$buildname" >> ${GITHUB_ENV} | |
echo "BUILD_SHA=$sha" >> ${GITHUB_ENV} | |
echo "TARGET: $target" | |
echo "OSGEO4W_PKG: $OSGEO4W_PKG" | |
echo "OSGEO4W_DEPS: $OSGEO4W_DEPS" | |
echo "MAJOR: $major" | |
echo "MINOR: $minor" | |
echo "PATCH: $patch" | |
echo "BINARY: $binary" | |
echo "VERSION: $version" | |
echo "BUILDNAME: $buildname" | |
echo "BUILD_SHA: $sha" | |
shell: bash | |
- name: Set up the working directory | |
run: | | |
mkdir C:\cygwin | |
mkdir C:\OSGeo4W64 | |
- name: copy runasadmin | |
shell: bash | |
run: | | |
cp ms-windows/osgeo4w/runasadmin.ps1 C:/cygwin/ | |
cp ms-windows/osgeo4w/runasadmin.ps1 C:/OSGeo4W64/ | |
- name: Download cygwin Installer | |
run: curl --output c:/setup-x86_64.exe https://cygwin.com/setup-x86_64.exe | |
- name: Download OSGeo4W V2 Installer | |
run: curl --output c:/osgeo4w-setup.exe http://ftp.osuosl.org/pub/osgeo/download/osgeo4w/osgeo4w-setup-v2.exe | |
- name: Download Ninja | |
run: curl --location-trusted --output c:/ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip | |
- name: Installing cygwin | |
run: C:/cygwin/runasadmin.ps1 c:/setup-x86_64.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/temp/cygwin -P "bison,flex,poppler,doxygen,unzip" | |
shell: powershell | |
working-directory: C:\cygwin | |
- name: Installing OSGeo4W V2 | |
run: > | |
C:/OSGeo4W64/runasadmin.ps1 c:/osgeo4w-setup.exe --autoaccept --advanced --arch $env:OSGEO4W_ARCH | |
--quiet-mode --upgrade-also --root $env:OSGEO4W_ROOT --only-site | |
-s http://ftp.osuosl.org/pub/osgeo/download/osgeo4w/v2 -l c:/temp/osgeo4w | |
-P $env:OSGEO4W_DEPS -P python3-core -P qt5-devel -P python3-devel -P grass -P python3-pyqt5 -P python3-pyqt5-sip | |
-P qt5-libs -P zstd-devel -P pdal-libs -P pdal -P pdal-devel -P draco -P draco-devel -P proj-devel -P curl-devel | |
-P libtiff-devel -P qscintilla -P python3-qscintilla -P qscintilla-devel | |
shell: powershell | |
working-directory: C:\OSGeo4W64 | |
- name: Checkout QGIS build patch | |
shell: cmd | |
run: | | |
git clone https://github.com/hxbb00/qgis-build.git C:\_work2 | |
- name: copy patch | |
shell: bash | |
run: | | |
cp -rf C:/_work2/ms-windows . | |
cp -rf C:/_work2/OSGeo4W/bin C:/OSGeo4W64 | |
- name: Clear package caches | |
run: | | |
rmdir /s /q c:\temp\cygwin | |
rmdir /s /q c:\temp\osgeo4w | |
shell: cmd | |
- name: Extracting Ninja | |
run: c:/cygwin/bin/unzip -o c:/ninja.zip -d $env:OSGEO4W_ROOT/bin | |
- name: Display tool versions | |
run: | | |
set PATH=%OSGEO4W_ROOT%\bin;%ProgramFiles%\CMake\bin;%PATH% | |
dir . /a | |
dir c:\ /a | |
dir c:\OSGeo4W64 /a | |
dir c:\OSGeo4W64\bin /a | |
dir c:\OSGeo4W64\apps /a | |
dir c:\OSGeo4W64\etc\ini /a | |
cmake --version | |
ctest --version | |
ninja --version | |
shell: cmd | |
- name: Building QGIS | |
run: | | |
echo on | |
set PATH=c:\cygwin\bin;%OSGEO4W_ROOT%\apps\Python39;%OSGEO4W_ROOT%\apps\Python39\Scripts;%OSGEO4W_ROOT%\bin;%PATH% | |
cd ms-windows/osgeo4w | |
type nul> skippackage | |
set OSGEO4W_CXXFLAGS=/MD /MP /Od /D NDEBUG | |
package-nightly.cmd %VERSION% %BINARY% %OSGEO4W_PKG% %OSGEO4W_ARCH% %BUILD_SHA% | |
shell: cmd | |
- name: pack build files | |
run: 7z a build-qgis-dev-x86_64.zip ./ms-windows/osgeo4w/build-qgis-dev-x86_64 | |
- name: set release date | |
run: | | |
echo "RELEASE_DATE=$(date +%Y%m%d-%H%M%s)" >> ${GITHUB_ENV} | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: build-qgis-dev-x86_64 | |
tag_name: ${{ env.RELEASE_DATE }} | |
files: build-qgis-dev-x86_64.zip | |