Commit 79169a0
Eric Bower
·
2026-06-12 22:06:41 -0400 EDT
parent af94b80
chore(ci): upload static site on main
2 files changed,
+19,
-13
+1,
-2
1@@ -12,6 +12,5 @@ WORKDIR /app
2
3 CMD ["sh", "-c", " \
4 cat README.md | pdocs -tmpl index.tmpl -toc | ssh pgs.sh /zmx/index.html && \
5- rsync -v ./logo.png pgs.sh:/zmx/ && \
6- rsync -rv dist/ pgs.sh:/zmx/a \
7+ rsync -v ./logo.png pgs.sh:/zmx/ \
8 "]
M
pico.sh
+18,
-11
1@@ -2,23 +2,34 @@
2 set -euo pipefail
3
4 export ZMX_SESSION_PREFIX="${ZMX_SESSION_PREFIX:-ci.zmx.}"
5-EVENT_TYPE="${PICO_CI_EVENT_TYPE:-manual}"
6+EVENT="${PICI_EVENT:-manual}"
7
8-echo "running ci event=${EVENT_TYPE} session=${ZMX_SESSION_PREFIX}"
9+echo "running ci event=${EVENT} session=${ZMX_SESSION_PREFIX}"
10
11 zmx run build docker build -t zig-zmx .
12 zmx run fmt -d docker run --rm -t zig-zmx:latest zig fmt --check .
13 zmx run test -d docker run --rm -t zig-zmx:latest zig build test
14-zmx run integration -d docker run --rm -t zig-zmx:latest bats test/session.bats
15+zmx run integration -d docker run --rm -t zig-zmx:latest bats test/*.bats
16 zmx wait "*"
17
18-if [[ $EVENT_TYPE != "git.tag" ]]; then
19+zmx run upload-build docker build -t zmx-upload -f Dockerfile.upload .
20+
21+if [[ $PICI_BRANCH = "main" ]]; then
22+ zmx run upload docker run --rm \
23+ -v "$(pwd)/README.md:/app/README.md:ro" \
24+ -v "$(pwd)/logo.png:/app/logo.png:ro" \
25+ -v "$(pwd)/index.tmpl:/app/index.tmpl:ro" \
26+ -v ~/.ssh:/root/.ssh:ro \
27+ zmx-upload
28+fi
29+
30+if [[ $EVENT != "git.tag" ]]; then
31 echo "success!"
32 exit 0
33 fi
34
35-TAG="${PICO_CI_TAG_NAME}"
36-NEW_VERSION="${PICO_CI_TAG_NAME#v}"
37+TAG="${PICI_TAG}"
38+NEW_VERSION="${PICI_TAG#v}"
39
40 zmx run semver sed -i "s/\.version = \"[^\"]*\"/.version = \"$NEW_VERSION\"/" build.zig.zon && cat build.zig.zon
41 zmx run update-readme sed -i "s/zmx-[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/zmx-$NEW_VERSION/g" README.md
42@@ -26,14 +37,10 @@ zmx run build-release -d docker run --rm -t zig-zmx:latest zig build release
43 zmx run brew -d bash gen-brew.sh "$NEW_VERSION"
44
45 echo "distributing bins"
46-zmx run upload-build docker build -t zmx-upload -f Dockerfile.upload .
47 zmx run upload docker run --rm \
48- -v "$(pwd)/README.md:/app/README.md:ro" \
49- -v "$(pwd)/logo.png:/app/logo.png:ro" \
50- -v "$(pwd)/index.tmpl:/app/index.tmpl:ro" \
51 -v "$(pwd)/zig-out/dist:/app/dist:ro" \
52 -v ~/.ssh:/root/.ssh:ro \
53- zmx-upload
54+ zmx-upload rsync -rv dist/ pgs.sh:/zmx/a
55 zmx run gh-build docker build -t gh-release -f Dockerfile.release .
56 zmx run gh docker run --rm \
57 -v "$(pwd)/zig-out/dist":/dist \