Skip to content

Commit

Permalink
Merge pull request #18 from softwareone-platform/feature/225739-publi…
Browse files Browse the repository at this point in the history
…sh-to-pypi

225739 Add publish action for CLI tool to PyPi repo
  • Loading branch information
d3rky authored May 28, 2024
2 parents ac5a54b + d3605bd commit d87737d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
21 changes: 19 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
[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"
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"
Expand Down
1 change: 0 additions & 1 deletion tests/test_swo/test_mpt/test_cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d87737d

Please sign in to comment.