-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (115 loc) · 3.78 KB
/
osgeo4w.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: OSGeo4W Windows Build
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- release-**
- queued_ltr_backports
paths:
- 'src/**'
- 'external/**'
- 'python/**'
- 'tests/**'
- 'ms-windows/**'
- 'CMakeLists.txt'
- '.github/workflows/osgeo4w.yml'
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
osgeo4w-build:
name: OSGeo4W Windows Build
runs-on: windows-latest
env:
CCACHE_DIR: build/ccache
PATH: C:\WINDOWS\system32;C:\Windows
steps:
- name: keep original line endings
run: |
git config --global core.autocrlf false
env:
PATH: C:\Program Files\Git\bin;C:\WINDOWS\system32;C:\Windows
- uses: actions/checkout@v4
with:
repository: 'jef-n/o4w-playground'
env:
PATH: C:\Program Files\Git\bin;C:\WINDOWS\system32;C:\Windows
- name: 'setup environment'
shell: cmd
run: |
echo on
call bootstrap.cmd none
path
echo CD:%CD%
cygwin\bin\cygpath -aw /bin
cygwin\bin\cygpath -aw /bin >>%GITHUB_PATH%
- name: 'determine package name'
shell: bash {0}
env:
SHELLOPTS: igncr
run: |
export PATH=/bin:/usr/bin
echo "GITHUB_REF: ${GITHUB_REF}"
echo "GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
set -xeo pipefail
RELBRANCH=$(git ls-remote --heads $GITHUB_SERVER_URL/$GITHUB_REPOSITORY "refs/heads/release-*_*" | sed -e '/\^{}$/d' -ne 's#^.*refs/heads/release-#release-#p' | sort -V | tail -1)
RELBRANCH=${RELBRANCH#*/}
LTRTAG=$(git ls-remote --tags $GITHUB_SERVER_URL/$GITHUB_REPOSITORY | sed -e '/\^{}$/d' -ne 's#^.*refs/tags/ltr-#ltr-#p' | sort -V | tail -1)
LTRBRANCH=release-${LTRTAG#ltr-}
if [ "$RELBRANCH" = "$LTRBRANCH" ]; then
LTRTAG=$(git ls-remote --tags $GITHUB_SERVER_URL/$GITHUB_REPOSITORY | sed -e '/\^{}$/d' -ne 's#^.*refs/tags/ltr-#ltr-#p' | sort -V | tail -2 | head -1)
LTRBRANCH=release-${LTRTAG#ltr-}
fi
case "${GITHUB_REF}" in
refs/pull/*/merge)
pr=${GITHUB_REF#refs/pull/}
pr=${pr%/merge}
branch=${GITHUB_BASE_REF##*/}
;;
*)
branch=${GITHUB_REF##*/}
;;
esac
echo BRANCH:$branch
case $branch in
$LTRBRANCH|queued_ltr_backports)
p=qgis-ltr-dev
;;
$RELBRANCH)
p=qgis-rel-dev
;;
master)
# TODO: qgis-qt6-dev
p=qgis-dev
;;
*)
echo "Could not determine package name from target branch $GITHUB_BASE_REF"
exit 1
;;
esac
echo PKG=$p >>$GITHUB_ENV
echo HOME:$HOME USERPROFILE:$USERPROFILE
HOME=$(cygpath -a $USERPROFILE) git config --global --add safe.directory $(cygpath -a $GITHUB_WORKSPACE/src/$p/qgis)
- uses: actions/checkout@v4
with:
path: 'src/${{ env.PKG }}/qgis'
- name: Restore build cache
uses: actions/cache/restore@v4
with:
path: build
key: build-ccache-osgeo4w-${{ github.event.pull_request.base.ref || github.ref_name }}
restore-keys: |
build-ccache-osgeo4w-master
- name: Build QGIS
shell: cmd
run: bootstrap.cmd %PKG%
- name: Save build cache for push only
uses: actions/cache/save@v4
if: ${{ github.event_name == 'push' }}
with:
path: build
key: build-ccache-osgeo4w-${{ github.ref_name }}-${{ github.run_id }}