-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
executable file
·54 lines (43 loc) · 1.46 KB
/
build.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
49
50
51
52
53
54
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"
# shellcheck disable=SC1091
source ./env
echo "module update"
git submodule update --init --remote
echo "checkout to desired version"
echo "checkout to finschia-sdk $FINSCHIA_SDK_VERSION"
cd ./repositories/finschia-sdk
git checkout "$FINSCHIA_SDK_VERSION"
echo "checkout to wasmd $WASMD_VERSION"
cd ../wasmd
git checkout "$WASMD_VERSION"
echo "checkout to ibc-go $IBC_GO_VERSION"
cd ../ibc-go
git checkout "$IBC_GO_VERSION"
echo "build js types"
cd ../../js
# install dependencies
yarn install
# Generate .ts files into ./src
yarn codegen
# Build .js/.d.ts files
yarn build
# Prepare publishing
yarn prepare
# Change version to latest
# shellcheck disable=SC2001
npm version "$(echo "$FINSCHIA_VERSION" | sed 's/^v//')"
echo "build java types"
cd ../java
# Generate .class and zip
./gradlew build
# Write new version info to README.md
cd ..
table_end_line=$(grep -n -m 1 "\-\-\-\-|\-\-\-\-" README.md | cut -d ":" -f 1)
content="| $FINSCHIA_VERSION | [$FINSCHIA_SDK_VERSION](https://github.com/Finschia/finschia-sdk/tree/$FINSCHIA_SDK_VERSION) | [$WASMD_VERSION](https://github.com/Finschia/wasmd/tree/$WASMD_VERSION) | [$IBC_GO_VERSION](https://github.com/Finschia/ibc-go/tree/$IBC_GO_VERSION) | [$FINSCHIA_VERSION](https://github.com/Finschia/finschia/tree/$FINSCHIA_VERSION) |"
# Insert the new row
sed -i "$((table_end_line+1))i\\
$content
" README.md
echo "content: $content"