Repository navigation
103 lines (90 loc) · 3.74 KB
/
Copy pathdeploy.yml
File metadata and controls
103 lines (90 loc) · 3.74 KB
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
name: Build and deploy
# Every push and pull request builds and checks the site; only master deploys.
on:
push:
pull_request:
# Manual re-run from the Actions tab, e.g. to refresh the changelog page
# (rendered at build time from Blockwork's CHANGELOG.md) after a release.
# Editor changes come in by moving BLOCKWORK_REV in qt-demo/sources.env.
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Never let two deploys race; a newer push supersedes an in-flight one.
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
# Blockwork at the pinned commit; blockstitch and lucide-qt at what its Cargo.lock pins.
- name: Fetch the editor's sources
run: qt-demo/deps.sh
# The home page's live editor is Blockwork's own Qt editor built for the
# browser (qt-demo/). Its sources and Qt/Emscripten versions are pinned
# in qt-demo/sources.env.
- name: Read the pinned versions
run: grep -E '^[A-Z_]+=' qt-demo/sources.env >> "$GITHUB_ENV"
- name: Cache Qt and Emscripten
uses: actions/cache@v4
with:
path: |
~/Qt
~/emsdk
key: qt-${{ env.QT_VERSION }}-emsdk-${{ env.EMSDK_VERSION }}
- name: Install Qt for WebAssembly
run: |
# The GL/xkb/font libraries are for the offscreen check below; its
# native configure also needs the GL headers (Qt6Gui's WrapOpenGL).
sudo apt-get update
sudo apt-get install -y ninja-build libgl1 libegl1 libxkbcommon0 libfontconfig1 \
libgl-dev libegl-dev libopengl-dev
if [ ! -d ~/Qt/$QT_VERSION/wasm_singlethread ]; then
pip install aqtinstall
# A desktop Qt of the same version supplies the host tools.
aqt install-qt linux desktop $QT_VERSION linux_gcc_64 -O ~/Qt
aqt install-qt all_os wasm $QT_VERSION wasm_singlethread -O ~/Qt
fi
if [ ! -d ~/emsdk ]; then
git clone --depth 1 https://github.com/emscripten-core/emsdk.git ~/emsdk
~/emsdk/emsdk install $EMSDK_VERSION
~/emsdk/emsdk activate $EMSDK_VERSION
fi
# The editor core (Blockwork's blockwork-web) is Rust, built natively
# for the check and for Emscripten for the page.
- name: Install the Rust target
run: rustup target add wasm32-unknown-emscripten
# A native build of the same page, loaded offscreen: fails on any QML
# warning (a module or file the editor needs but the build lacks) and on
# any editor command DemoBackend neither handles nor declares.
- name: Check the editor's modules and commands
run: qt-demo/check.sh
env:
QT_DESKTOP: /home/runner/Qt/${{ env.QT_VERSION }}/gcc_64
- name: Build the editor
run: qt-demo/build.sh
env:
QT_WASM: /home/runner/Qt/${{ env.QT_VERSION }}/wasm_singlethread
QT_HOST_PATH: /home/runner/Qt/${{ env.QT_VERSION }}/gcc_64
EMSDK: /home/runner/emsdk
# Installs the pnpm version pinned in package.json's `packageManager`,
# runs `pnpm run build` (astro check && astro build), and uploads dist/
# (public/demo/ included).
- name: Build
uses: withastro/action@v6
deploy:
needs: build
# Other branches and pull requests only check that the site builds.
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v5