Skip to content

Build

Build #23

Workflow file for this run

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