-
-
Notifications
You must be signed in to change notification settings - Fork 9
140 lines (136 loc) · 4.2 KB
/
build.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
134
135
136
137
138
139
140
name: Build
on:
workflow_dispatch
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-qgis-js:
env:
qt: "6.5.2"
qtModules: "qt5compat"
pythonVersion: "3.12"
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 8
- name: Update apt cache
run: >-
sudo apt-get update
- name: Install system dependencies
run: >-
sudo apt-get install -y
ninja-build
pkg-config
flex
bison
- name: Fix to install python with "actions/setup-python@v4" on act
if: ${{ env.ACT }}
run: |
# Hack to get setup-python to work on act
# (see https://github.com/nektos/act/issues/251)
if [ ! -f "/etc/lsb-release" ] ; then
echo "DISTRIB_RELEASE=20.04" > /etc/lsb-release
fi
- uses: actions/setup-python@v4
with:
python-version: ${{env.pythonVersion}}
# - name: Restore Qt cache
# uses: actions/cache@v2
# id: cache-qt
# with:
# path: ${{runner.workspace}}/Qt/${{env.qt}}
# key: ${{runner.os}}-qt-${{env.qt}}
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
dir: "${{ github.workspace }}/build"
# cached: ${{steps.cache-qt.outputs.cache-hit}}
setup-python: "false"
set-env: "false"
# from https://ddalcino.github.io/aqt-list-server/
aqtversion: "==3.1.*"
version: ${{env.qt}}
host: "linux"
target: "desktop"
arch: "wasm_multithread"
# qt modules required by qgis-js
modules: ${{env.qtModules}}
# workaround for gcc_64 host tools (see https://github.com/jurplel/install-qt-action/issues/181)
py7zrversion: "==0.20.*"
extra: "--autodesktop"
- name: Patch Qt
run: |
(
cd ${{ github.workspace }}/build/Qt/${{env.qt}};
patch -p0 < ${{ github.workspace }}/build/qt-patches/egl.patch &&
patch -p0 < ${{ github.workspace }}/build/qt-patches/exceptions.patch
)
- name: Set QGIS_JS_QT
run: |
echo "QGIS_JS_QT=${{ github.workspace }}/build/Qt/${{env.qt}}" >> "$GITHUB_ENV"
- name: Setup node from package.json
uses: actions/setup-node@v4
with:
node-version-file: "package.json"
- uses: pnpm/action-setup@v2
- name: Install dependencies
run: pnpm install
- name: Compile qgis-js
run: pnpm run compile:release
- name: Save logs on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: vcpkg-buildtrees-logs
path: build/vcpkg/buildtrees/**/*.log
- name: Build qgis-js packages
run: pnpm run build
- uses: actions/upload-artifact@v3
with:
name: "package-qgis-js"
path: |
packages/qgis-js/package.json
packages/qgis-js/README.md
packages/qgis-js/dist/**/*
- uses: actions/upload-artifact@v3
with:
name: "package-qgis-js-utils"
path: |
packages/qgis-js-utils/package.json
packages/qgis-js-utils/README.md
packages/qgis-js-utils/dist/**/*
- uses: actions/upload-artifact@v3
with:
name: "package-qgis-js-ol"
path: |
packages/qgis-js-ol/package.json
packages/qgis-js-ol/README.md
packages/qgis-js-ol/dist/**/*
- name: Build site
run: pnpm run dev:build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./sites/dev/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1