Skip to content

Commit 2e112ff

Browse files
authored
Merge pull request #17 from agntcy/publish-pypi
feat: Add GHA to publish to PyPi.
2 parents 1b9dfb9 + 199d38e commit 2e112ff

File tree

3 files changed

+66
-10
lines changed

3 files changed

+66
-10
lines changed

Diff for: .github/workflows/pypi.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Publish Python Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+'
8+
workflow_dispatch:
9+
10+
env:
11+
POETRY_VERSION: "2.1.1"
12+
13+
jobs:
14+
pypi-publish:
15+
name: Publish release to PyPI
16+
runs-on: ubuntu-latest
17+
environment:
18+
name: pypi
19+
url: https://pypi.org/project/agntcy-iomapper
20+
permissions:
21+
id-token: write
22+
contents: read
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '>=3.9'
31+
update-environment: true
32+
33+
- name: Install Poetry
34+
run: |
35+
pipx install poetry==${{ env.POETRY_VERSION }}
36+
37+
- name: Validate version if tag
38+
if: github.event_name == 'push' && github.ref_type == 'tag'
39+
env:
40+
TAG_NAME: ${{ github.ref_name }}
41+
run: |
42+
TAG="${TAG_NAME##v}"
43+
PYPROJECT_VERSION=$(awk '/version/ { gsub("\"", ""); print $3; exit; }' pyproject.toml)
44+
45+
if [ ! "${PYPROJECT_VERSION}" = "${TAG}" ]; then
46+
echo "You created the \"${{ github.ref_name }}\" git tag; it is fine, BUT it does not match the pyproject.toml file"
47+
exit 1
48+
fi
49+
50+
echo "Building and publishing version: ${PYPROJECT_VERSION}" >> $GITHUB_STEP_SUMMARY
51+
52+
- name: Build package
53+
env:
54+
POETRY_VIRTUALENVS_IN_PROJECT: "true"
55+
run: |
56+
poetry build
57+
58+
- name: Publish package distributions to PyPI
59+
uses: pypa/gh-action-pypi-publish@release/v1

Diff for: README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# IO-Mapper Agent
22

3-
[![Release](https://img.shields.io/github/v/release/agntcy/iomapper-agnt?display_name=tag)](CHANGELOG.md)
4-
[![Contributor-Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-fbab2c.svg)](CODE_OF_CONDUCT.md)
3+
[![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)
54

65
## About The Project
76

@@ -44,18 +43,18 @@ To get a local copy up and running follow these simple steps.
4443
## Usage
4544

4645
Learn how to use our different Mappers
47-
[USAGE.md](_usage.md)
46+
[USAGE.md](https://agntcy.github.io/iomapper-agnt/#_usage.md)
4847

4948
## Contributing
5049

5150
Contributions are what make the open source community such an amazing place to
5251
learn, inspire, and create. Any contributions you make are **greatly
5352
appreciated**. For detailed contributing guidelines, please see
54-
[CONTRIBUTING.md](CONTRIBUTING.md)
53+
[CONTRIBUTING.md](https://github.com/agntcy/acp-sdk/blob/main/docs/CONTRIBUTING.md)
5554

5655
## Copyright Notice and License
5756

58-
[Copyright Notice and License](./LICENSE)
57+
[Copyright Notice and License](https://github.com/agntcy/acp-sdk/blob/main/LICENSE)
5958

6059
Copyright (c) 2025 Cisco and/or its affiliates.
6160

Diff for: pyproject.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
[project]
22
name = "agntcy-iomapper"
3-
version = "0.2.0"
3+
version = "0.2.0a0"
44
license = "Apache-2.0"
55
description = "A tool to transform output from one agent to the input of another."
66
readme = "README.md"
77
authors = [
8-
{ name = "Jeff Napper", email = "[email protected]" },
9-
{ name = "Reginaldo Costa", email = "[email protected]" },
8+
{ name = "AGNTCY Internet of Agents Collective", email = "[email protected]" },
109
]
1110
maintainers = [
12-
{ name = "Jeff Napper", email = "[email protected]" },
13-
{ name = "Reginaldo Costa", email = "[email protected]" },
11+
{ name = "AGNTCY Internet of Agents Collective", email = "[email protected]" },
1412
]
1513

1614
[tool.poetry.dependencies]

0 commit comments

Comments
 (0)