release scripts fixes

This commit is contained in:
azivner 2017-12-25 21:05:08 -05:00
parent 29fd78aee5
commit 87e7828440
2 changed files with 20 additions and 8 deletions

View file

@ -1,7 +1,5 @@
#!/usr/bin/env bash
echo 'module.exports = { build_date:"'`date --iso-8601=seconds`'", build_revision: "'`git log -1 --format="%H"`'" };' > services/build.js
echo "Deleting dist"
rm -r dist/*

View file

@ -18,35 +18,49 @@ if ! git diff-index --quiet HEAD --; then
exit 1
fi
echo "Releasing Trilium $VERSION"
jq '.version = "'$VERSION'"' package.json|sponge package.json
echo 'module.exports = { build_date:"'`date --iso-8601=seconds`'", build_revision: "'`git log -1 --format="%H"`'" };' > services/build.js
TAG=v$VERSION
git commit -m "$VERSION"
echo "Committing package.json version change"
git commit -m "release $VERSION"
git push
echo "Tagging commit with $TAG"
git tag $TAG
git push origin $TAG
echo "Releasing Trilium $VERSION"
bin/build.sh
build
package
bin/package.sh
LINUX_BUILD=trilium-linux-$VERSION.7z
WINDOWS_BUILD=trilium-windows-$VERSION.7z
echo "Creating release in GitHub"
github-release release \
--tag $TAG \
--name "$TAG release"
echo "Uploading linux build"
github-release upload \
--tag $TAG \
--name "$LINUX_BUILD" \
--file "dist/$LINUX_BUILD"
echo "Uploading windows build"
github-release upload \
--tag $TAG \
--name "$WINDOWS_BUILD" \
--file "dist/$WINDOWS_BUILD"
--file "dist/$WINDOWS_BUILD"
echo "Release finished!"