-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathMakefile
74 lines (61 loc) · 2.27 KB
/
Makefile
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
SHELL=/usr/bin/env bash
ORDERED_PACKAGES:=fil_actors_runtime \
fil_actor_account \
fil_actor_cron \
fil_actor_init \
fil_actor_market \
fil_actor_miner \
fil_actor_multisig \
fil_actor_paych \
fil_actor_power \
fil_actor_reward \
fil_actor_system \
fil_actor_verifreg \
fil_builtin_actors_bundle
# How much to "bump" the version by on release.
BUMP ?= patch
VERSION ?= $(error VERSION environment variable must be set)
# Run cargo check
check: deps-build
cargo check --workspace --tests --benches --lib --bins --examples
# Ensure we have the build dependencies
deps-build:
rustup target add wasm32-unknown-unknown
# Print out the current "bundle" version.
version: deps-release
@cargo metadata -q --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "fil_builtin_actors_bundle") | .version'
# Run cargo test
test: deps-build
cargo test --workspace
# Release a new version. Specify the version "bump" with BUMP
bump-version: check-clean deps-release check test
echo "$(ORDERED_PACKAGES)" | xargs -n1 cargo set-version --bump $(BUMP) -p
cargo update --workspace
@echo "Bumped actors to version $$($(MAKE) --quiet version)"
set-version: check-clean deps-release check test
echo "$(ORDERED_PACKAGES)" | xargs -n1 cargo set-version $(VERSION) -p
cargo update --workspace
@echo "Set actors to version $(VERSION)"
# Publish the current version to crates.io
publish:
for pkg in "$(ORDERED_PACKAGES)"; do cargo publish -p "$$pkg" && sleep 5; done
# Create a bundle in a deterministic location
bundle: deps-build
cargo run -- -o output/builtin-actors.car
# Check if the working tree is clean.
check-clean:
@git diff --quiet || { \
echo "Working tree dirty, please commit any changes first."; \
exit 1; \
}
# Check if we have the required deps.
deps-release:
@which jq >/dev/null 2>&1 || { \
echo "Please install jq"; \
exit 1; \
}
@which cargo-set-version >/dev/null 2>&1 || { \
echo "Please install cargo-edit: 'cargo install cargo-edit'."; \
exit 1; \
}
.PHONY: check check-clean deps deps-release deps-release test publish bump-version set-version bundle