Automate releases
This commit is contained in:
parent
033c7f55f8
commit
ad6bc4e99b
1 changed files with 34 additions and 0 deletions
34
release.sh
Normal file
34
release.sh
Normal file
|
@ -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
|
Loading…
Reference in a new issue