-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (25 loc) · 691 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (25 loc) · 691 Bytes
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
run:
cargo run --
test:
cargo test
build:
cargo build
install:
cargo install --path .
confet &
release:
@VERSION=$$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/'); \
MAJOR=$$(echo $$VERSION | cut -d. -f1); \
MINOR=$$(echo $$VERSION | cut -d. -f2); \
PATCH=$$(echo $$VERSION | cut -d. -f3); \
NEW_PATCH=$$((PATCH + 1)); \
NEW_VERSION="$$MAJOR.$$MINOR.$$NEW_PATCH"; \
sed -i "s/^version = \"$$VERSION\"/version = \"$$NEW_VERSION\"/" Cargo.toml; \
cargo check --quiet; \
git add Cargo.toml Cargo.lock; \
git commit -m "v$$NEW_VERSION"; \
git tag "v$$NEW_VERSION"; \
git push && git push --tags; \
cargo publish; \
echo "Released v$$NEW_VERSION"
confet &