Skip to content

Commit

Permalink
GitHub Actions "build" workflow fixes and GitHub Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
boardend committed Nov 2, 2023
1 parent 87fbdf7 commit bc69df4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build

on:
workflow_dispatch
# push:
Expand All @@ -7,15 +8,32 @@ on:
# 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
Expand Down Expand Up @@ -76,17 +94,34 @@ jobs:
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: "qgis-js"
name: "package-qgis-js"
path: |
packages/qgis-js/package.json
packages/qgis-js/dist/**/*
- uses: actions/upload-artifact@v3
with:
name: "@qgis-js/ol"
name: "package-qgis-js-ol"
path: |
packages/qgis-js-ol/package.json
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
3 changes: 2 additions & 1 deletion build/scripts/compile.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
set -eo pipefail

$(echo ./build/vcpkg/downloads/tools/cmake-*/*/bin/cmake) \
# if vcpkg has installed its own cmake, use that, otherwise use the system cmake
$(find . -iwholename './build/vcpkg/downloads/tools/cmake-*/*/bin/cmake' | grep bin/cmake || echo cmake) \
-S . \
-B build/wasm \
-G Ninja \
Expand Down
4 changes: 2 additions & 2 deletions qgis-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ export class CompileAction extends CommandLineAction {
process.env.EMCC_DEBUG = "1";
}

// locate CMake from vcpkg
const cmake = await vcpkgTool("cmake-*/*/bin/cmake");
// if vcpkg has installed its own cmake, use that, otherwise use the system cmake
const cmake = await $`find . -iwholename './build/vcpkg/downloads/tools/cmake-*/*/bin/cmake' | grep bin/cmake || echo cmake`;

// configure and build vcpgk dependencies
await $`${cmake} \
Expand Down

0 comments on commit bc69df4

Please sign in to comment.