-
Notifications
You must be signed in to change notification settings - Fork 589
/
release
executable file
·45 lines (37 loc) · 1.49 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
#!/bin/bash
# Make a gnirehtet release.
#
# Put your keystore properties into ~/.gradle/gradle.properties
# (check app/build.gradle)
set -e # fail on error
GRADLE=${GRADLE:-./gradlew} # set value ./gradlew if not set
DIST=dist
TARGET_DIR_JAVA=gnirehtet-java
TARGET_DIR_RUST_LINUX=gnirehtet-rust-linux64
TARGET_DIR_RUST_WIN=gnirehtet-rust-win64
version=$(git describe --tags --always)
TARGET_JAVA="$TARGET_DIR_JAVA-$version".zip
TARGET_RUST_LINUX="$TARGET_DIR_RUST_LINUX-$version".zip
TARGET_RUST_WIN="$TARGET_DIR_RUST_WIN-$version".zip
"$GRADLE" checkAll releaseAll releaseRustWindows
rm -rf "$DIST"
for dir in "$TARGET_DIR_JAVA" "$TARGET_DIR_RUST_LINUX" "$TARGET_DIR_RUST_WIN"
do
mkdir -p "$DIST/$dir"
cp app/build/outputs/apk/release/gnirehtet-release.apk "$DIST/$dir"/gnirehtet.apk
done
cp relay-java/build/libs/gnirehtet.jar \
relay-java/scripts/gnirehtet \
relay-java/scripts/gnirehtet.cmd \
relay-java/scripts/gnirehtet-run.cmd \
"$DIST/$TARGET_DIR_JAVA"/
cp relay-rust/target/release/gnirehtet "$DIST/$TARGET_DIR_RUST_LINUX"/
strip "$DIST/$TARGET_DIR_RUST_LINUX"/gnirehtet # remove symbols for smaller binary
cp relay-rust/target/x86_64-pc-windows-gnu/release/gnirehtet.exe \
relay-rust/scripts/gnirehtet-run.cmd \
"$DIST/$TARGET_DIR_RUST_WIN"/
cd "$DIST"
zip -r "$TARGET_JAVA" "$TARGET_DIR_JAVA"
zip -r "$TARGET_RUST_LINUX" "$TARGET_DIR_RUST_LINUX"
zip -r "$TARGET_RUST_WIN" "$TARGET_DIR_RUST_WIN"
sha256sum "$TARGET_JAVA" "$TARGET_RUST_LINUX" "$TARGET_RUST_WIN" > SHA256SUMS.txt