-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease
executable file
·75 lines (61 loc) · 1.98 KB
/
release
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
75
#!/bin/bash
VERSION=$1
confirmation() {
read confirm
if [ "$confirm" != "y" ]
then
echo "Aborting";
exit 1
fi
}
echo -ne "Preparing for release ${VERSION}. Is this correct? [y/n] "
confirmation
if git rev-parse --quiet --verify $REVISION > /dev/null; then
echo "Release branch exists already"
else
echo "Creating release branch"
git checkout main && \
git pull && \
git checkout -b release/${VERSION} && \
git push -u origin release/${VERSION}
fi
echo -ne "Did you finish merging all features into 'release/${VERSION}'? [y/n] "
confirmation
git checkout release/${VERSION} && git pull
echo "Running linter and unittests"
cargo clippy && \
cargo fmt && \
cargo test
echo "Running basic check of GTF and RefGene convertion"
diff \
<( cargo run -- \
-f gtf -i tests/data/example.gtf \
-t refgene -o /dev/stdout 2> /dev/null | \
sort ) \
tests/data/example.refgene
diff \
<( cargo run -- \
-f refgene -i tests/data/example.refgene \
-t gtf -g ncbiRefSeq.2021-05-17 \
-o /dev/stdout 2> /dev/null | \
cut -f1-5,7-8 | sort ) \
<( cut -f1-5,7-8 tests/data/example.gtf)
echo "Updating version number"
sed -i .bck "s/^version =.*$/version = \"${VERSION}\"/" ./Cargo.toml
cargo build
git commit -am "Release ${VERSION}"
git tag ${VERSION}
git push
git push --tags
echo -ne "Do you want to build the binaries now? [y/n] "
confirmation
cargo build --release --target=aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/atg target/atg-${VERSION}-aarch64-apple-darwin
cargo build --release --target=x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/atg target/atg-${VERSION}-x86_64-unknown-linux-gnu
cargo build --release --target=x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-musl/release/atg target/atg-${VERSION}-x86_64-unknown-linux-musl
echo "You can now merge release/${VERSION} into main, create a new release and upload the binaries"
echo -ne "Do you want to publish atg to crates.io now? [y/n] "
confirmation
cargo publish