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
......@@ -12,6 +12,5 @@ WORKDIR /app
1212
1313 CMD ["sh", "-c", " \
1414 cat README.md | pdocs -tmpl index.tmpl -toc | ssh pgs.sh /zmx/index.html && \
15- rsync -v ./logo.png pgs.sh:/zmx/ && \
16- rsync -rv dist/ pgs.sh:/zmx/a \
15+ rsync -v ./logo.png pgs.sh:/zmx/ \
1716 "]
+18, -11
......@@ -2,23 +2,34 @@
22 set -euo pipefail
33
44 export ZMX_SESSION_PREFIX="${ZMX_SESSION_PREFIX:-ci.zmx.}"
5-EVENT_TYPE="${PICO_CI_EVENT_TYPE:-manual}"
5+EVENT="${PICI_EVENT:-manual}"
66
7-echo "running ci event=${EVENT_TYPE} session=${ZMX_SESSION_PREFIX}"
7+echo "running ci event=${EVENT} session=${ZMX_SESSION_PREFIX}"
88
99 zmx run build docker build -t zig-zmx .
1010 zmx run fmt -d docker run --rm -t zig-zmx:latest zig fmt --check .
1111 zmx run test -d docker run --rm -t zig-zmx:latest zig build test
12-zmx run integration -d docker run --rm -t zig-zmx:latest bats test/session.bats
12+zmx run integration -d docker run --rm -t zig-zmx:latest bats test/*.bats
1313 zmx wait "*"
1414
15-if [[ $EVENT_TYPE != "git.tag" ]]; then
15+zmx run upload-build docker build -t zmx-upload -f Dockerfile.upload .
16+
17+if [[ $PICI_BRANCH = "main" ]]; then
18+ zmx run upload docker run --rm \
19+ -v "$(pwd)/README.md:/app/README.md:ro" \
20+ -v "$(pwd)/logo.png:/app/logo.png:ro" \
21+ -v "$(pwd)/index.tmpl:/app/index.tmpl:ro" \
22+ -v ~/.ssh:/root/.ssh:ro \
23+ zmx-upload
24+fi
25+
26+if [[ $EVENT != "git.tag" ]]; then
1627 echo "success!"
1728 exit 0
1829 fi
1930
20-TAG="${PICO_CI_TAG_NAME}"
21-NEW_VERSION="${PICO_CI_TAG_NAME#v}"
31+TAG="${PICI_TAG}"
32+NEW_VERSION="${PICI_TAG#v}"
2233
2334 zmx run semver sed -i "s/\.version = \"[^\"]*\"/.version = \"$NEW_VERSION\"/" build.zig.zon && cat build.zig.zon
2435 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
......@@ -26,14 +37,10 @@ zmx run build-release -d docker run --rm -t zig-zmx:latest zig build release
2637 zmx run brew -d bash gen-brew.sh "$NEW_VERSION"
2738
2839 echo "distributing bins"
29-zmx run upload-build docker build -t zmx-upload -f Dockerfile.upload .
3040 zmx run upload docker run --rm \
31- -v "$(pwd)/README.md:/app/README.md:ro" \
32- -v "$(pwd)/logo.png:/app/logo.png:ro" \
33- -v "$(pwd)/index.tmpl:/app/index.tmpl:ro" \
3441 -v "$(pwd)/zig-out/dist:/app/dist:ro" \
3542 -v ~/.ssh:/root/.ssh:ro \
36- zmx-upload
43+ zmx-upload rsync -rv dist/ pgs.sh:/zmx/a
3744 zmx run gh-build docker build -t gh-release -f Dockerfile.release .
3845 zmx run gh docker run --rm \
3946 -v "$(pwd)/zig-out/dist":/dist \