diff --git a/lets.yaml b/lets.yaml index d111f24b..612d8567 100644 --- a/lets.yaml +++ b/lets.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 81565716..11744b7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 00000000..d324feac --- /dev/null +++ b/scripts/release.sh @@ -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 \ No newline at end of file diff --git a/scripts/release_check.sh b/scripts/release_check.sh deleted file mode 100755 index 13fc8a46..00000000 --- a/scripts/release_check.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [[ $(git status hiku -s) ]]; then - echo "Working directory is not clean" - false -else - true -fi