diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8aab854 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +# This workflow is triggered when a PR is merged whose source branch's name starts with "release" and whose target branch is "main". +# It checks for the current package version (in pyproject.toml) and the latest tag on GitHub. +# If package version is more recent, it builds the project, uploads to PYPI, creates a Tag and makes a release on GitHub. +# Secrets PYPI_USERNAME and PYPI_PASSWORD are required! + +name: Check and release +on: + pull_request: + branches: [main] + types: [closed] + +jobs: + build: + name: Release + defaults: + run: + shell: bash + + if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release') + runs-on: ubuntu-latest + steps: + + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install Poetry + run: | + export POETRY_HOME=/opt/poetry + python3 -m venv $POETRY_HOME + $POETRY_HOME/bin/pip install poetry==1.4.0 + $POETRY_HOME/bin/poetry --version + + - name: Run release script + env: + PYPI_USERNAME: __token__ + PYPI_PASSWORD: ${{ secrets.FETCHBOT_PYPI_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} + run: | + pip install tomli packaging poetry + git config --global user.email "ci-bot@fetch.ai" + git config --global user.name "CI BOT" + python3 ./scripts/do_release.py \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 4aa5a91..593711e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "appdirs" version = "1.4.4" description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "main" optional = false python-versions = "*" files = [ @@ -16,7 +15,6 @@ files = [ name = "astroid" version = "2.12.13" description = "An abstract syntax tree for Python with inference support." -category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -36,7 +34,6 @@ wrapt = [ name = "attrs" version = "22.1.0" description = "Classes Without Boilerplate" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -54,7 +51,6 @@ tests-no-zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy name = "backports.cached-property" version = "1.0.2" description = "cached_property() - computed once per instance, cached as attribute" -category = "main" optional = false python-versions = ">=3.6.0" files = [ @@ -66,7 +62,6 @@ files = [ name = "bech32" version = "1.2.0" description = "Reference implementation for Bech32 and segwit addresses." -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -78,7 +73,6 @@ files = [ name = "binapy" version = "0.6.0" description = "Binary Data manipulation, for humans." -category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -93,7 +87,6 @@ typing-extensions = ">=4.3.0,<5.0.0" name = "black" version = "22.10.0" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -138,7 +131,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "blessings" version = "1.7" description = "A thin, practical wrapper around terminal coloring, styling, and positioning" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -154,7 +146,6 @@ six = "*" name = "certifi" version = "2022.9.24" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -166,7 +157,6 @@ files = [ name = "cffi" version = "1.15.1" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = "*" files = [ @@ -243,7 +233,6 @@ pycparser = "*" name = "charset-normalizer" version = "2.1.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" optional = false python-versions = ">=3.6.0" files = [ @@ -258,7 +247,6 @@ unicode-backport = ["unicodedata2"] name = "click" version = "8.1.3" description = "Composable command line interface toolkit" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -273,7 +261,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -283,21 +270,20 @@ files = [ [[package]] name = "cosmpy" -version = "0.9.1" +version = "0.9.2" description = "A library for interacting with the cosmos networks" -category = "main" optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "cosmpy-0.9.1-py3-none-any.whl", hash = "sha256:bf1f332618ba4bbdf751706883372072e0e807abffe071b8a5ef8e2d27500804"}, - {file = "cosmpy-0.9.1.tar.gz", hash = "sha256:ffb7940e19445964d8d58f7e5617f850a54deab9244f6a81b91846438b66ca00"}, + {file = "cosmpy-0.9.2-py3-none-any.whl", hash = "sha256:3591311198b08a0aa75340851ca166669974f17ffaa207a8d2cb26504fb0fa19"}, + {file = "cosmpy-0.9.2.tar.gz", hash = "sha256:0f0eb80152f28ef5ee4d846d581d2e34ba2d952900f0e3570cacb84bb376f664"}, ] [package.dependencies] bech32 = "*" ecdsa = "*" googleapis-common-protos = "*" -grpcio = "1.51.1" +grpcio = "*" jsonschema = ">=3.2.0,<5" protobuf = ">=4.21.6,<5.0dev" pycryptodome = ">=3.18.0,<4.0.0" @@ -308,7 +294,6 @@ requests = "*" name = "coverage" version = "7.0.3" description = "Code coverage measurement for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -372,7 +357,6 @@ toml = ["tomli"] name = "cryptography" version = "38.0.4" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -419,7 +403,6 @@ test = ["hypothesis (>=1.11.4,!=3.79.2)", "iso8601", "pretend", "pytest (>=6.2.0 name = "darglint" version = "1.8.1" description = "A utility for ensuring Google-style docstrings stay up to date with the source code." -category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -431,7 +414,6 @@ files = [ name = "dill" version = "0.3.6" description = "serialize all of python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -446,7 +428,6 @@ graph = ["objgraph (>=1.7.2)"] name = "docker" version = "6.0.1" description = "A Python library for the Docker Engine API." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -468,7 +449,6 @@ ssh = ["paramiko (>=2.4.3)"] name = "ecdsa" version = "0.18.0" description = "ECDSA cryptographic signature library (pure python)" -category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -487,7 +467,6 @@ gmpy2 = ["gmpy2"] name = "exceptiongroup" version = "1.0.4" description = "Backport of PEP 654 (exception groups)" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -502,7 +481,6 @@ test = ["pytest (>=6)"] name = "flake8" version = "5.0.4" description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" optional = false python-versions = ">=3.6.1" files = [ @@ -519,7 +497,6 @@ pyflakes = ">=2.5.0,<2.6.0" name = "ghp-import" version = "2.1.0" description = "Copy your docs directly to the gh-pages branch." -category = "main" optional = false python-versions = "*" files = [ @@ -537,7 +514,6 @@ dev = ["flake8", "markdown", "twine", "wheel"] name = "googleapis-common-protos" version = "1.57.0" description = "Common protobufs used in Google APIs" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -555,7 +531,6 @@ grpc = ["grpcio (>=1.44.0,<2.0.0dev)"] name = "graphlib-backport" version = "1.0.3" description = "Backport of the Python 3.9 graphlib module for Python 3.6+" -category = "main" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -567,7 +542,6 @@ files = [ name = "grpcio" version = "1.51.1" description = "HTTP/2-based RPC framework" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -625,7 +599,6 @@ protobuf = ["grpcio-tools (>=1.51.1)"] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -637,7 +610,6 @@ files = [ name = "importlib-metadata" version = "5.1.0" description = "Read metadata from Python packages" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -657,7 +629,6 @@ testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packag name = "importlib-resources" version = "5.10.1" description = "Read resources from Python packages" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -676,7 +647,6 @@ testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-chec name = "iniconfig" version = "1.1.1" description = "iniconfig: brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = "*" files = [ @@ -688,7 +658,6 @@ files = [ name = "isort" version = "5.10.1" description = "A Python utility / library to sort Python imports." -category = "dev" optional = false python-versions = ">=3.6.1,<4.0" files = [ @@ -706,7 +675,6 @@ requirements-deprecated-finder = ["pip-api", "pipreqs"] name = "jaraco.classes" version = "3.2.3" description = "Utility functions for Python class constructs" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -725,7 +693,6 @@ testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-chec name = "jedi" version = "0.18.2" description = "An autocompletion tool for Python that can be used for text editors." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -745,7 +712,6 @@ testing = ["Django (<3.1)", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] name = "jeepney" version = "0.8.0" description = "Low-level, pure Python DBus protocol wrapper." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -761,7 +727,6 @@ trio = ["async_generator", "trio"] name = "Jinja2" version = "3.1.2" description = "A very fast and expressive template engine." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -779,7 +744,6 @@ i18n = ["Babel (>=2.7)"] name = "jsonschema" version = "4.17.3" description = "An implementation of JSON Schema validation for Python" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -801,7 +765,6 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339- name = "jwskate" version = "0.4.1" description = "A Pythonic implementation of Json Web Signature, Keys, Algorithms, Tokens and Encryption (RFC7514 to 7519), on top of the `cryptography` module." -category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -819,7 +782,6 @@ typing-extensions = ">=4.3.0" name = "keyring" version = "23.11.0" description = "Store and access your passwords safely." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -842,7 +804,6 @@ testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-chec name = "lazy-object-proxy" version = "1.8.0" description = "A fast and thorough lazy object proxy." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -871,7 +832,6 @@ files = [ name = "makefun" version = "1.15.0" description = "Small library to dynamically create python functions." -category = "main" optional = false python-versions = "*" files = [ @@ -883,7 +843,6 @@ files = [ name = "Markdown" version = "3.3.7" description = "Python implementation of Markdown." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -901,7 +860,6 @@ testing = ["coverage", "pyyaml"] name = "MarkupSafe" version = "2.1.1" description = "Safely add untrusted strings to HTML/XML markup." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -951,7 +909,6 @@ files = [ name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -963,7 +920,6 @@ files = [ name = "mergedeep" version = "1.3.4" description = "A deep merge function for 🐍." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -975,7 +931,6 @@ files = [ name = "mkdocs" version = "1.4.2" description = "Project documentation with Markdown." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1004,7 +959,6 @@ min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4)", "ghp-imp name = "mkdocs-material" version = "8.5.11" description = "Documentation that simply works" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1025,7 +979,6 @@ requests = ">=2.26" name = "mkdocs-material-extensions" version = "1.1.1" description = "Extension pack for Python Markdown and MkDocs Material." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1037,7 +990,6 @@ files = [ name = "more-itertools" version = "9.0.0" description = "More routines for operating on iterables, beyond itertools" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1049,7 +1001,6 @@ files = [ name = "mypy" version = "0.971" description = "Optional static typing for Python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1092,7 +1043,6 @@ reports = ["lxml"] name = "mypy-extensions" version = "0.4.3" description = "Experimental type system extensions for programs checked with the mypy typechecker." -category = "dev" optional = false python-versions = "*" files = [ @@ -1104,7 +1054,6 @@ files = [ name = "packaging" version = "21.3" description = "Core utilities for Python packages" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1119,7 +1068,6 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" name = "parso" version = "0.8.3" description = "A Python Parser" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1135,7 +1083,6 @@ testing = ["docopt", "pytest (<6.0.0)"] name = "pathspec" version = "0.10.2" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1147,7 +1094,6 @@ files = [ name = "pkgutil_resolve_name" version = "1.3.10" description = "Resolve a name to an object." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1159,7 +1105,6 @@ files = [ name = "platformdirs" version = "2.6.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1175,7 +1120,6 @@ test = ["appdirs (==1.4.4)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock name = "pluggy" version = "1.0.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1191,7 +1135,6 @@ testing = ["pytest", "pytest-benchmark"] name = "prompt-toolkit" version = "3.0.36" description = "Library for building powerful interactive command lines in Python" -category = "main" optional = false python-versions = ">=3.6.2" files = [ @@ -1206,7 +1149,6 @@ wcwidth = "*" name = "protobuf" version = "4.24.3" description = "" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1229,7 +1171,6 @@ files = [ name = "ptpython" version = "3.0.23" description = "Python REPL build on top of prompt_toolkit" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1251,7 +1192,6 @@ ptipython = ["ipython"] name = "pycodestyle" version = "2.9.1" description = "Python style guide checker" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1263,7 +1203,6 @@ files = [ name = "pycparser" version = "2.21" description = "C parser in Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1275,7 +1214,6 @@ files = [ name = "pycryptodome" version = "3.19.0" description = "Cryptographic library for Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -1317,7 +1255,6 @@ files = [ name = "pyflakes" version = "2.5.0" description = "passive checker of Python programs" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1329,7 +1266,6 @@ files = [ name = "Pygments" version = "2.13.0" description = "Pygments is a syntax highlighting package written in Python." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1344,7 +1280,6 @@ plugins = ["importlib-metadata"] name = "pylint" version = "2.15.9" description = "python code static checker" -category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -1374,7 +1309,6 @@ testutils = ["gitpython (>3)"] name = "pymdown-extensions" version = "9.9" description = "Extension pack for Python Markdown." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1389,7 +1323,6 @@ markdown = ">=3.2" name = "pyparsing" version = "3.0.9" description = "pyparsing module - Classes and methods to define and execute parsing grammars" -category = "main" optional = false python-versions = ">=3.6.8" files = [ @@ -1404,7 +1337,6 @@ diagrams = ["jinja2", "railroad-diagrams"] name = "pyrsistent" version = "0.19.2" description = "Persistent/Functional/Immutable data structures" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1436,7 +1368,6 @@ files = [ name = "pytest" version = "7.2.0" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1460,7 +1391,6 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2. name = "python-dateutil" version = "2.8.2" description = "Extensions to the standard Python datetime module" -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -1475,7 +1405,6 @@ six = ">=1.5" name = "pywin32" version = "305" description = "Python for Window Extensions" -category = "main" optional = false python-versions = "*" files = [ @@ -1499,7 +1428,6 @@ files = [ name = "pywin32-ctypes" version = "0.2.0" description = "" -category = "main" optional = false python-versions = "*" files = [ @@ -1511,7 +1439,6 @@ files = [ name = "PyYAML" version = "6.0" description = "YAML parser and emitter for Python" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1561,7 +1488,6 @@ files = [ name = "pyyaml_env_tag" version = "0.1" description = "A custom YAML tag for referencing environment variables in YAML files. " -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1576,7 +1502,6 @@ pyyaml = "*" name = "requests" version = "2.28.1" description = "Python HTTP for Humans." -category = "main" optional = false python-versions = ">=3.7, <4" files = [ @@ -1598,7 +1523,6 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "SecretStorage" version = "3.3.3" description = "Python bindings to FreeDesktop.org Secret Service API" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1614,7 +1538,6 @@ jeepney = ">=0.6" name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1626,7 +1549,6 @@ files = [ name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" -category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1638,7 +1560,6 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1650,7 +1571,6 @@ files = [ name = "tomlkit" version = "0.11.6" description = "Style preserving TOML library" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1662,7 +1582,6 @@ files = [ name = "tqdm" version = "4.64.1" description = "Fast, Extensible Progress Meter" -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ @@ -1683,7 +1602,6 @@ telegram = ["requests"] name = "typing-extensions" version = "4.4.0" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1695,7 +1613,6 @@ files = [ name = "urllib3" version = "1.26.13" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ @@ -1712,7 +1629,6 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] name = "watchdog" version = "2.2.0" description = "Filesystem events monitoring" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1753,7 +1669,6 @@ watchmedo = ["PyYAML (>=3.10)"] name = "wcwidth" version = "0.2.5" description = "Measures the displayed width of unicode strings in a terminal" -category = "main" optional = false python-versions = "*" files = [ @@ -1765,7 +1680,6 @@ files = [ name = "websocket-client" version = "1.4.2" description = "WebSocket client for Python with low level API options" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1782,7 +1696,6 @@ test = ["websockets"] name = "wrapt" version = "1.14.1" description = "Module for decorators, wrappers and monkey patching." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" files = [ @@ -1805,6 +1718,16 @@ files = [ {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8ad85f7f4e20964db4daadcab70b47ab05c7c1cf2a7c1e51087bfaa83831854c"}, {file = "wrapt-1.14.1-cp310-cp310-win32.whl", hash = "sha256:a9a52172be0b5aae932bef82a79ec0a0ce87288c7d132946d645eba03f0ad8a8"}, {file = "wrapt-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:6d323e1554b3d22cfc03cd3243b5bb815a51f5249fdcbb86fda4bf62bab9e164"}, + {file = "wrapt-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ecee4132c6cd2ce5308e21672015ddfed1ff975ad0ac8d27168ea82e71413f55"}, + {file = "wrapt-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2020f391008ef874c6d9e208b24f28e31bcb85ccff4f335f15a3251d222b92d9"}, + {file = "wrapt-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2feecf86e1f7a86517cab34ae6c2f081fd2d0dac860cb0c0ded96d799d20b335"}, + {file = "wrapt-1.14.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:240b1686f38ae665d1b15475966fe0472f78e71b1b4903c143a842659c8e4cb9"}, + {file = "wrapt-1.14.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9008dad07d71f68487c91e96579c8567c98ca4c3881b9b113bc7b33e9fd78b8"}, + {file = "wrapt-1.14.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6447e9f3ba72f8e2b985a1da758767698efa72723d5b59accefd716e9e8272bf"}, + {file = "wrapt-1.14.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:acae32e13a4153809db37405f5eba5bac5fbe2e2ba61ab227926a22901051c0a"}, + {file = "wrapt-1.14.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:49ef582b7a1152ae2766557f0550a9fcbf7bbd76f43fbdc94dd3bf07cc7168be"}, + {file = "wrapt-1.14.1-cp311-cp311-win32.whl", hash = "sha256:358fe87cc899c6bb0ddc185bf3dbfa4ba646f05b1b0b9b5a27c2cb92c2cea204"}, + {file = "wrapt-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:26046cd03936ae745a502abf44dac702a5e6880b2b01c29aea8ddf3353b68224"}, {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:43ca3bbbe97af00f49efb06e352eae40434ca9d915906f77def219b88e85d907"}, {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:6b1a564e6cb69922c7fe3a678b9f9a3c54e72b469875aa8018f18b4d1dd1adf3"}, {file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:00b6d4ea20a906c0ca56d84f93065b398ab74b927a7a3dbd470f6fc503f95dc3"}, @@ -1856,7 +1779,6 @@ files = [ name = "zipp" version = "3.11.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1871,4 +1793,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "9f2812f4a3657355247ba129d33d5bfc2c6ab21025fa2d5643b80ec60c59566d" +content-hash = "a80cda47d03f926cc8544e0a125814124040b2eae46d5f3c8768d83fa2fb8e9e" diff --git a/pyproject.toml b/pyproject.toml index 0e848f2..1d6863f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jenesis" -version = "0.7.0" +version = "0.7.1" description = "Command line tool for rapid CosmWasm-based smart contract development" authors = ["Ed FitzGerald ", "James Riehl ", "Alejandro Madrigal "] license = "Apache" @@ -16,7 +16,7 @@ blessings = "^1.7" ptpython = "^3.0.23" toml = "^0.10.2" tqdm = "^4.64.0" -cosmpy = "^0.9.1" +cosmpy = "^0.9.2" mkdocs = "^1.3.1" mkdocs-material = "^8.3.9" keyring = "^23.9.0" diff --git a/scripts/do_release.py b/scripts/do_release.py new file mode 100755 index 0000000..cd83bc6 --- /dev/null +++ b/scripts/do_release.py @@ -0,0 +1,136 @@ +"""Release automation script.""" + +import os +import subprocess +import sys +from pathlib import Path + +import tomli +from packaging.version import Version + +ROOT = Path(__file__).parent.parent + + +class EnvCredentials: + """Credentials from env variables.""" + + @property + def pypi_username(self) -> str: + """Get PYPI username.""" + return os.environ.get("PYPI_USERNAME") or "" + + @property + def pypi_password(self) -> str: + """Get PYPI password.""" + return os.environ.get("PYPI_PASSWORD") or "" + + +def get_the_latest_release_version() -> Version: + """Get release version from gihtub tags.""" + text = subprocess.check_output("git ls-remote --tags origin", shell=True, text=True) + tags = [i.split("\t")[1].strip() for i in text.splitlines()] + tags = [i for i in tags if i.startswith("refs/tags/v") and not i.endswith("^{}")] + versions = [i.replace("refs/tags/v", "") for i in tags] + return Version(versions[-1]) + + +def get_current_version() -> Version: + """Get current code version.""" + text = (ROOT / "pyproject.toml").read_text() + version = tomli.loads(text)["tool"]["poetry"]["version"] + return Version(version) + + +def do_we_need_to_release() -> bool: + """Check is code version is newer than on github.""" + current_version = get_current_version() + released_version = get_the_latest_release_version() + return current_version > released_version + + +def make_tag(current_version: Version) -> None: + """Make git tag.""" + subprocess.check_call( + f"git tag v{current_version} -m 'Release {current_version}'", shell=True + ) + + +def push_tag(current_version) -> None: + """Push tag to github.""" + subprocess.check_call(f"git push origin v{current_version}", shell=True) + + +def make_release(current_version: Version) -> None: + """Make release on Github.""" + subprocess.check_call( + f"""gh release create v{current_version} --title "v{current_version}" + --latest""", + shell=True, + ) + + +def build_packages(): + """Build packages.""" + subprocess.check_call("poetry build", shell=True) + + +class ReleaseTool: + """Release helper tool.""" + + def __init__(self, credentials: EnvCredentials) -> None: + """Init release tool instance.""" + self._credentials = credentials + + def upload_packages(self): + """Upload packages to PYPI.""" + result = subprocess.run( + f"poetry publish --skip-existing --username {self._credentials.pypi_username} " + f"--password {self._credentials.pypi_password} --verbose", + check=True, + shell=True, + stdout=sys.stdout, + stderr=sys.stderr, + ) + if result.returncode != 0: + raise RuntimeError("Upload pacakges failed!") + + def main(self): + """Run release process.""" + current_version = get_current_version() + latest_release_version = get_the_latest_release_version() + + print("Current version:", current_version) + print("Latest release version:", latest_release_version) + + if current_version > latest_release_version: + print("Current version is newer. Good to go.") + else: + print("Current version is not newer. Exiting.") + return + + print("\nBuilding packages") + build_packages() + print("Packages built") + + print("\nUpload packages") + self.upload_packages() + print("Packages uploaded") + + print("\nMake tag") + make_tag(current_version) + print("Tag made") + + print("\nPush tag") + push_tag(current_version) + print("Tag pushed") + + print("\nMake release") + make_release(current_version) + print("Release made." "") + + print("\nDONE") + + +if __name__ == "__main__": + creds = EnvCredentials() + ReleaseTool(creds).main()