diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..02dd0f7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 'Get the version' + id: get_version + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT" + + - name: Build and publish to PyPI + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + poetry version ${{ steps.get_version.outputs.VERSION }} + poetry build + if [ "$(curl -s -o /dev/null -w '%{http_code}' https://pypi.org/pypi/mpt-cli/${{ steps.tag.outputs.result }}/json)" = "404" ]; then poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD; fi diff --git a/README.md b/README.md index 3a5b1f3..7c68c2b 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,11 @@ Command line utility for SoftwareOne Marketplace Platform $ docker-compose build app_test $ docker-compose run --service-ports app_test ``` + +# Command Line Interface +To list all available commands use + + +``` +mpt-cli --help +``` diff --git a/pyproject.toml b/pyproject.toml index 767286e..cc83153 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] -name = "swo-marketplace-cli" -version = "0.1.0" +name = "mpt-cli" +version = "2.0.0" description = "Command line utility for SoftwareOne Marketplace Platform" authors = ["SoftwareOne AG"] license = "Apache-2.0 license" @@ -8,6 +8,23 @@ packages = [ { include = "swo" } ] readme = "README.md" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.12", + "Topic :: Utilities" +] +keywords = [ + "fulfillment", + "command", + "line", + "interface", + "utility", + "cli", + "softwareone", + "marketplace", +] [tool.poetry.dependencies] python = ">=3.12,<4" diff --git a/tests/test_swo/test_mpt/test_cli/test_cli.py b/tests/test_swo/test_mpt/test_cli/test_cli.py index 81fff3c..2e8e9f4 100644 --- a/tests/test_swo/test_mpt/test_cli/test_cli.py +++ b/tests/test_swo/test_mpt/test_cli/test_cli.py @@ -29,4 +29,3 @@ def test_alias_group_error(): def test_version(): result = runner.invoke(app, ["--version"]) assert result.exit_code == 0 - assert "0.1.0" in result.stdout