-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·85 lines (61 loc) · 2.3 KB
/
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
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
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env sh
set -e
VERSION=$(cargo pkgid | sed -E 's/.*#([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
./build.sh
rm -rf target/*.tgz target/*.tgz.sig target/release.md
echo "Creating v${VERSION} bundle for Mac OS ARM64..."
APPLE_ARM64_TARGET="slowkey-${VERSION}-osx-arm64.tgz"
APPLE_ARM64_TARGET_SIG=${APPLE_ARM64_TARGET}.sig
APPLE_ARM64_RELEASE="target/${APPLE_ARM64_TARGET}"
APPLE_ARM64_RELEASE_SIG=${APPLE_ARM64_RELEASE}.sig
tar zcvf ${APPLE_ARM64_RELEASE} target/aarch64-apple-darwin/release/slowkey
APPLE_ARM64_RELEASE_SHA512=$(shasum -a512 ${APPLE_ARM64_RELEASE})
gpg --output ${APPLE_ARM64_RELEASE_SIG} --detach-sig ${APPLE_ARM64_RELEASE}
echo "Creating v${VERSION} bundle for Mac OS x64..."
APPLE_X64_TARGET="slowkey-${VERSION}-osx-x64.tgz"
APPLE_X64_TARGET_SIG=${APPLE_X64_TARGET}.sig
APPLE_X64_RELEASE="target/${APPLE_X64_TARGET}"
APPLE_X64_RELEASE_SIG=${APPLE_X64_RELEASE}.sig
tar zcvf ${APPLE_X64_RELEASE} target/x86_64-apple-darwin/release/slowkey
APPLE_X64_RELEASE_SHA512=$(shasum -a512 ${APPLE_X64_RELEASE})
gpg --output ${APPLE_X64_RELEASE_SIG} --detach-sig ${APPLE_X64_RELEASE}
echo "Creating v${VERSION} bundle for Linux X64..."
LINUX_X64_TARGET="slowkey-${VERSION}-linux-x64.tgz"
LINUX_X64_TARGET_SIG=${LINUX_X64_TARGET}.sig
LINUX_X64_RELEASE="target/${LINUX_X64_TARGET}"
LINUX_X64_RELEASE_SIG=${LINUX_X64_RELEASE}.sig
tar zcvf ${LINUX_X64_RELEASE} target/x86_64-unknown-linux-musl/release/slowkey
LINUX_X64_RELEASE_SHA512=$(shasum -a512 ${LINUX_X64_RELEASE})
gpg --output ${LINUX_X64_RELEASE_SIG} --detach-sig ${LINUX_X64_RELEASE}
RELEASE_NOTES="target/release.md"
echo "Preparing release notes..."
cat <<EOF >$RELEASE_NOTES
# Release Notes v${VERSION}
## Mac OS ARM64
Calculate the SHA512:
\`\`\`sh
shasum -a512 ${APPLE_ARM64_RELEASE} ${APPLE_ARM64_RELEASE_SHA512}
\`\`\`
Verify the digital signature:
\`\`\`sh
gpg --verify ${APPLE_ARM64_TARGET_SIG} ${APPLE_ARM64_TARGET}
\`\`\`
## Mac OS x64
Calculate the SHA512:
\`\`\`sh
shasum -a512 ${APPLE_X64_RELEASE} ${APPLE_X64_RELEASE_SHA512}
\`\`\`
Verify the digital signature:
\`\`\`sh
gpg --verify ${APPLE_X64_TARGET_SIG} ${APPLE_X64_TARGET}
\`\`\`
## Linux X64
Calculate the SHA512:
\`\`\`sh
shasum -a512 ${LINUX_X64_RELEASE} ${LINUX_X64_RELEASE_SHA512}
\`\`\`
Verify the digital signature:
\`\`\`sh
gpg --verify ${LINUX_X64_TARGET_SIG} ${LINUX_X64_TARGET}
\`\`\`
EOF