aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rwxr-xr-xutils/bump-version.sh23
-rwxr-xr-xutils/create-signed-manifest.sh27
-rwxr-xr-xutils/generate_changelog.sh38
3 files changed, 88 insertions, 0 deletions
diff --git a/utils/bump-version.sh b/utils/bump-version.sh
new file mode 100755
index 0000000..408e585
--- /dev/null
+++ b/utils/bump-version.sh
@@ -0,0 +1,23 @@
+#|/usr/bin/env sh
+
+set -e
+
+script_dir=$(dirname -- "$(readlink -f "$0")")
+root_dir=$script_dir/..
+
+cwd=$(pwd)
+cd "$root_dir"
+
+version=$(head -n 1 docs/CHANGELOG.md | cut -f 1 -d ' ')
+
+sed -i -E 's/^version = .+$/version = "'"$version"'"/' Cargo.toml
+cargo build
+git add Cargo.toml Cargo.lock docs/CHANGELOG.md
+git commit -m "Bump to v$version"
+git tag -a v"$version" -m "$(utils/generate_changelog.sh)"
+
+git push
+git push mandibles
+cargo publish
+
+cd "$cwd"
diff --git a/utils/create-signed-manifest.sh b/utils/create-signed-manifest.sh
new file mode 100755
index 0000000..2df1d93
--- /dev/null
+++ b/utils/create-signed-manifest.sh
@@ -0,0 +1,27 @@
+#|/usr/bin/env sh
+
+set -e
+
+script_dir=$(dirname -- "$(readlink -f "$0")")
+
+tag=$(git -C "$script_dir" describe --tags --abbrev=0)
+
+cwd=$(pwd)
+cd "$(mktemp -d)"
+
+wget "https://github.com/sommerfelddev/viewercount/releases/download/$tag/viewercount-$tag-darwin-x86_64.tar.gz"
+wget "https://github.com/sommerfelddev/viewercount/releases/download/$tag/viewercount-$tag-linux-x86_64.tar.gz"
+wget "https://github.com/sommerfelddev/viewercount/releases/download/$tag/viewercount-$tag-linux-aarch64.tar.gz"
+wget "https://github.com/sommerfelddev/viewercount/releases/download/$tag/viewercount-$tag-windows-x86_64.zip"
+
+sha256sum -b -- * > viewercount-"$tag"-manifest.txt
+
+sha256sum --check viewercount-"$tag"-manifest.txt
+
+gpg -b --armor viewercount-"$tag"-manifest.txt
+
+gpg --verify viewercount-"$tag"-manifest.txt.asc
+
+pwd
+
+cd "$cwd"
diff --git a/utils/generate_changelog.sh b/utils/generate_changelog.sh
new file mode 100755
index 0000000..ca9274b
--- /dev/null
+++ b/utils/generate_changelog.sh
@@ -0,0 +1,38 @@
+#|/usr/bin/env sh
+
+set -e
+
+script_dir=$(dirname -- "$(readlink -f "$0")")
+root_dir=$script_dir/..
+
+cwd=$(pwd)
+cd "$root_dir"
+
+version=$(head -n 1 docs/CHANGELOG.md | cut -f 1 -d ' ')
+
+sed '/^$/q' docs/CHANGELOG.md
+
+printf 'Verifying the release
+---------------------
+
+0. Import my gpg public key into your keyring (you only need to do this once, not for every release):
+
+```bash
+gpg --auto-key-locate clear,wkd --locate-keys sommerfeld@sommerfeld.dev
+```
+
+1. Download `viewercount-v%s-manifest.txt` and `viewercount-v%s-manifest.txt.asc` to the same directory where you are downloading the binary.
+2. Verify the gpg signature is mine (should ouput `Good signature`)`:
+
+```bash
+gpg --verify viewercount-v%s-manifest.txt.asc
+```
+
+3. Verify the checksums of the binaries (should output `OK`):
+
+```bash
+sha256sum --check --ignore-missing viewercount-v%s-manifest.txt
+```
+' "$version" "$version" "$version" "$version"
+
+cd "$cwd"