forked from dfinity/nns-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PROPOSAL_TEMPLATE.sh
executable file
·57 lines (46 loc) · 1.74 KB
/
PROPOSAL_TEMPLATE.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
55
56
57
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
mkdir -p release/ci
PR="$(git log -n1 tags/release-candidate --oneline | awk '{print $(NF)}' | tr -cd 0-9)"
CI="https://github.com/dfinity/nns-dapp/pull/${PR}/checks"
WASM="release/ci/nns-dapp.wasm"
if test -f "$WASM"; then
SHA="$(sha256sum "$WASM" | awk '{print $1}')"
else
echo "Please populate ${WASM} and run this again."
exit 0
fi
cat <<EOF >release/PROPOSAL.md
# Upgrade frontend NNS Dapp canister to commit \`$(git rev-parse tags/release-candidate)\`
Wasm sha256 hash: \`${SHA}\` (\`${CI}\`)
## Change Log:
* Write about...
* ... what has changed
* ... in simple bullet points
## Commit log:
\`\`\`
+ bash -xc "git log --format='%C(auto) %h %s' $(git rev-parse --short tags/prod)..$(git rev-parse --short tags/release-candidate)"
$(bash -xc "git log --format='%C(auto) %h %s' $(git rev-parse --short tags/prod)..$(git rev-parse --short tags/release-candidate)")
\`\`\`
## Wasm Verification
To build the wasm module yourself and verify its hash, run the following commands from the root of the [nns-dapp repo](https://github.com/dfinity/nns-dapp):
\`\`\`
git fetch # to ensure you have the latest changes.
git checkout "$(git rev-parse tags/release-candidate)"
./scripts/docker-build
sha256sum nns-dapp.wasm
\`\`\`
EOF
cat <<EOF >release/ROLLBACK.md
# Downgrade frontend NNS Dapp canister to commit \`$(git rev-parse tags/release-candidate)\`
Wasm sha256 hash: \`${SHA}\` (\`${WASM}\`)
## Wasm Verification
To build the wasm module yourself and verify its hash, run the following commands from the root of the nns-dapp repo:
\`\`\`
git fetch # to ensure you have the latest changes.
git checkout "$(git rev-parse tags/release-candidate)"
./scripts/docker-build
sha256sum nns-dapp.wasm
\`\`\`
EOF