From ad6bc4e99b303379e934c4be0d21fad09afa5567 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Tue, 13 Sep 2022 23:27:42 -0600 Subject: [PATCH] Automate releases --- release.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 release.sh diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..a299ad4 --- /dev/null +++ b/release.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env sh + +VERSION="$1" +TAG="release-v${VERSION}" + + +if git tag | grep "$TAG"; then + git checkout "$TAG" +else + git reset --hard + git clean -fd + sed -i "s/__version__.*/__version__ = \"${VERSION}\"/g" src/python/cram/__init__.py + git commit src/python/cram/__init__.py -m "[automated] Release version ${VERSION}" + git tag "release-v${VERSION}" + git push + git push --tags +fi + +bazel build cram + +TON="$HOME/ton" +mkdir -p "$TON/key" +cp ~/.ssh/id_arrdem@arrdem.pub "$TON/key" +chmod 644 "$TON/key"/* + +D="$TON/pkg/arrdem/cram/v${VERSION}" +BUILD="${D}/cram" +SIG="${D}/cram.sig" +mkdir -p "$D" +cp -f ./bazel-bin/cram "${BUILD}" +rm -f "${SIG}" +ssh-keygen -Y sign -f ~/.ssh/id_arrdem@arrdem -n "${SIG}" "${BUILD}" + +git checkout trunk