diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..ff1a14d --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,59 @@ +name: Publish Python Package + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' + workflow_dispatch: + +env: + POETRY_VERSION: "2.1.1" + +jobs: + pypi-publish: + name: Publish release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/agntcy-iomapper + permissions: + id-token: write + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '>=3.9' + update-environment: true + + - name: Install Poetry + run: | + pipx install poetry==${{ env.POETRY_VERSION }} + + - name: Validate version if tag + if: github.event_name == 'push' && github.ref_type == 'tag' + env: + TAG_NAME: ${{ github.ref_name }} + run: | + TAG="${TAG_NAME##v}" + PYPROJECT_VERSION=$(awk '/version/ { gsub("\"", ""); print $3; exit; }' pyproject.toml) + + if [ ! "${PYPROJECT_VERSION}" = "${TAG}" ]; then + echo "You created the \"${{ github.ref_name }}\" git tag; it is fine, BUT it does not match the pyproject.toml file" + exit 1 + fi + + echo "Building and publishing version: ${PYPROJECT_VERSION}" >> $GITHUB_STEP_SUMMARY + + - name: Build package + env: + POETRY_VIRTUALENVS_IN_PROJECT: "true" + run: | + poetry build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index 503a6ac..39a0cfe 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # IO-Mapper Agent -[![Release](https://img.shields.io/github/v/release/agntcy/iomapper-agnt?display_name=tag)](CHANGELOG.md) -[![Contributor-Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-fbab2c.svg)](CODE_OF_CONDUCT.md) +[![Contributor-Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-fbab2c.svg)](https://github.com/agntcy/acp-sdk/blob/main/CODE_OF_CONDUCT.md) ## About The Project @@ -44,18 +43,18 @@ To get a local copy up and running follow these simple steps. ## Usage Learn how to use our different Mappers -[USAGE.md](_usage.md) +[USAGE.md](https://agntcy.github.io/iomapper-agnt/#_usage.md) ## Contributing Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. For detailed contributing guidelines, please see -[CONTRIBUTING.md](CONTRIBUTING.md) +[CONTRIBUTING.md](https://github.com/agntcy/acp-sdk/blob/main/docs/CONTRIBUTING.md) ## Copyright Notice and License -[Copyright Notice and License](./LICENSE) +[Copyright Notice and License](https://github.com/agntcy/acp-sdk/blob/main/LICENSE) Copyright (c) 2025 Cisco and/or its affiliates. diff --git a/pyproject.toml b/pyproject.toml index 7f0f8d7..c8f0aab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,14 @@ [project] name = "agntcy-iomapper" -version = "0.2.0" +version = "0.2.0a0" license = "Apache-2.0" description = "A tool to transform output from one agent to the input of another." readme = "README.md" authors = [ - { name = "Jeff Napper", email = "jenapper@cisco.com" }, - { name = "Reginaldo Costa", email = "regcosta@cisco.com" }, + { name = "AGNTCY Internet of Agents Collective", email = "pypi@agntcy.io" }, ] maintainers = [ - { name = "Jeff Napper", email = "jenapper@cisco.com" }, - { name = "Reginaldo Costa", email = "regcosta@cisco.com" }, + { name = "AGNTCY Internet of Agents Collective", email = "pypi@agntcy.io" }, ] [tool.poetry.dependencies]