diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 517726d..f1a11fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,5 @@ name: Build + on: workflow_dispatch # push: @@ -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 @@ -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 diff --git a/build/scripts/compile.sh b/build/scripts/compile.sh index cc19b3d..282f24b 100755 --- a/build/scripts/compile.sh +++ b/build/scripts/compile.sh @@ -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 \ diff --git a/qgis-js.ts b/qgis-js.ts index 9733d9e..b69b2d1 100755 --- a/qgis-js.ts +++ b/qgis-js.ts @@ -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} \