forked from blockworks-foundation/voter-stake-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-release.sh
executable file
·30 lines (23 loc) · 955 Bytes
/
run-release.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
#!/usr/bin/env bash
set -euo pipefail
if [[ -z "${PROVIDER_WALLET}" ]]; then
echo "Please provide path to a provider wallet keypair."
exit -1
fi
if [[ -z "${VERSION_MANUALLY_BUMPED}" ]]; then
echo "Please bump versions in package.json and in cargo.toml."
exit -1
fi
# build program
anchor build
# update on chain program and IDL, atm used for testing/developing
anchor deploy --provider.cluster devnet --provider.wallet ${PROVIDER_WALLET}
anchor idl upgrade --provider.cluster devnet --provider.wallet ${PROVIDER_WALLET}\
--filepath target/idl/voter_stake_registry.json 4Q6WW2ouZ6V3iaNm56MTd5n2tnTm4C5fiH8miFHnAFHo
# update types in npm package and publish the npm package
cp ./target/types/voter_stake_registry.ts src/voter_stake_registry.ts
yarn clean && yarn build && cp package.json ./dist/ && yarn publish dist
echo
echo Remember to commit and push the version update as well as the changes
echo to src/voter_stake_registry.ts .
echo