forked from jD91mZM2/xidlehook
-
Notifications
You must be signed in to change notification settings - Fork 2
/
publish.sh
executable file
·48 lines (35 loc) · 997 Bytes
/
publish.sh
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
#!/usr/bin/env bash
set -e
git reset
do_package() {
echo "Running tests..."
cargo check --manifest-path "$1/Cargo.toml"
cargo test --manifest-path "$1/Cargo.toml"
cargo check --all-features --manifest-path "$1/Cargo.toml"
cargo test --all-features --manifest-path "$1/Cargo.toml"
# If the lock file is changed, update that
git add "$1/Cargo.lock"
git commit --amend --no-edit
echo "Making sure packaging works..."
cargo publish --dry-run --manifest-path "$1"/Cargo.toml
git status
echo "Publishing $1!!! Press enter to continue."
read -r
cargo publish --manifest-path "$1"/Cargo.toml
}
mv Cargo.toml Cargo.toml.bak
cleanup() {
mv Cargo.toml.bak Cargo.toml
}
trap cleanup SIGINT
do_package xidlehook-core
echo "Waiting for crates.io to update"
sleep 5
do_package xidlehook-daemon
echo "Now updating root lock file"
rm Cargo.lock
cargo check
git add Cargo.lock
git commit --amend --no-edit
echo "Now make a tag! Yay!"
cleanup