[READ-ONLY] Mirror of https://github.com/mrgnw/spatial-maker.
2.0 kB
81 lines
1set shell := ["bash", "-euo", "pipefail", "-c"]
2
3version := `grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/'`
4tag := "v" + version
5
6# Build all workspace crates (debug)
7build:
8 cargo build --workspace
9
10# Build all workspace crates (release)
11build-release:
12 cargo build --workspace --release
13
14# Build the UI
15build-ui:
16 cd ui && pnpm install && pnpm build
17
18# Build everything: UI + all crates (release)
19build-all: build-ui build-release
20
21# Cross-compile release archives for all targets
22dist: build-ui
23 #!/bin/bash
24 set -euo pipefail
25 bin="ubermind"
26 dist="dist"
27 targets=(
28 aarch64-apple-darwin
29 x86_64-apple-darwin
30 aarch64-unknown-linux-musl
31 x86_64-unknown-linux-musl
32 )
33 echo "building ${bin} {{tag}}"
34 echo
35 rm -rf "${dist}"
36 mkdir -p "${dist}"
37 for target in "${targets[@]}"; do
38 echo "--- ${target}"
39 case "${target}" in
40 *-apple-*) cargo build --release --target "${target}" ;;
41 *-linux-*) cargo zigbuild --release --target "${target}" ;;
42 esac
43 archive="${bin}-{{tag}}-${target}.tar.gz"
44 tar -czf "${dist}/${archive}" -C "target/${target}/release" "${bin}" "ubermind-daemon"
45 echo " -> ${dist}/${archive}"
46 echo
47 done
48 echo "all builds complete"
49 echo
50 ls -lh "${dist}/"
51
52# Build dist archives and create a GitHub release
53release: dist
54 #!/bin/bash
55 set -euo pipefail
56 echo
57 read -p "create github release {{tag}}? [y/N] " confirm
58 if [[ "${confirm}" != "y" ]]; then
59 echo "skipped"
60 exit 0
61 fi
62 gh release create "{{tag}}" \
63 --title "{{tag}}" \
64 --generate-notes \
65 dist/*.tar.gz
66 echo
67 echo "released {{tag}}"
68 echo " https://github.com/mrgnw/ubermind/releases/tag/{{tag}}"
69 echo
70 echo "don't forget: just publish"
71
72# Publish all crates to crates.io (in dependency order)
73publish:
74 cargo publish -p ubermind-core
75 cargo publish -p ubermind
76 cargo publish -p ubermind-daemon
77
78# Install locally (debug build)
79install:
80 cargo install --path crates/ubermind-cli
81 cargo install --path crates/ubermind-daemon