Skip to content

Commit

Permalink
introduce release.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
m.kindritskiy committed Mar 25, 2024
1 parent b0718c1 commit 56516f4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 32 deletions.
3 changes: 1 addition & 2 deletions lets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ commands:
Example:
lets release 0.7.1 --message="Added federation"
lets release 0.7.2rc1 --message="Added feature"
cmd: |
VERSION=${LETSOPT_VERSION} MESSAGE=${LETSOPT_MESSAGE} pdm run release
cmd: ./scripts/release.sh ${LETSOPT_VERSION} "${LETSOPT_MESSAGE}"

_build-base:
description: Build base docker image
Expand Down
23 changes: 0 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,6 @@ docs-open = "open docs/build/index.html"
check = {composite = ["fmt", "test", "mypy", "flake"]}
example = "python examples/{args:graphql_flask}.py"

[tool.pdm.scripts.release]
shell = """
set -e
USAGE="Usage: VERSION=<> MESSAGE=<> pdm run release"
if [ -z "${VERSION}" ]; then
echo $USAGE
echo "VERSION is not set"
exit 1
fi
if [ -z "${MESSAGE}" ]; then
echo $USAGE
echo "MESSAGE is not set"
exit 1
fi
echo "__version__ = \\"${VERSION}\\"" > hiku/__init__.py
git add hiku/__init__.py
git commit -m "Release ${VERSION}"
git tag -a v${VERSION} -m "${MESSAGE}"
git push origin master --tags
"""
env = {VERSION = "", MESSAGE = ""}

[tool.pytest.ini_options]
addopts = "--tb=native --benchmark-disable"
testpaths = [
Expand Down
25 changes: 25 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# /bin/env bash

set -e
USAGE="Usage: release.sh 0.1.1 'Release message'"

VERSION=$1
MESSAGE=$2

if [ -z "${VERSION}" ]; then
echo $USAGE
echo "VERSION is not set"
exit 1
fi
if [ -z "${MESSAGE}" ]; then
echo $USAGE
echo "MESSAGE is not set"
exit 1
fi
echo "Releasing ${VERSION}"

echo "__version__ = \"${VERSION}\"" > hiku/__init__.py
git add hiku/__init__.py
git commit -m "Release ${VERSION}"
git tag -a v${VERSION} -m "${MESSAGE}"
git push origin master --tags
7 changes: 0 additions & 7 deletions scripts/release_check.sh

This file was deleted.

0 comments on commit 56516f4

Please sign in to comment.