Repository navigation
build!: publish to PyPI, with the protocol distribution renamed to agentenv-framework-protocol #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ea34dfd
ci: publish releases to PyPI
earakely-scale b3d2c1b
build!: rename the protocol distribution to agentenv-framework-protocol
earakely-scale 0e5a3f1
ci: keep the protocol's former name on the internal release index
earakely-scale 05d73ed
Merge remote-tracking branch 'origin/main' into ci/publish-to-pypi
earakely-scale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: Publish to PyPI | ||
|
|
||
| # On a release tag, uploads agentenv-framework-protocol and then agentenv-framework to PyPI through trusted | ||
| # publishing, so no token is stored anywhere. Each job builds its distribution the way the release does | ||
| # (agentenv-framework pinned to the exact agentenv-framework-protocol it was released with) and runs in its own | ||
| # environment, because PyPI binds a pending publisher to one workflow and environment per project. Files already on | ||
| # PyPI are skipped, so a rerun is safe. | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| protocol: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| environment: pypi-protocol | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install uv from public PyPI | ||
| run: python -m pip install --quiet --index-url https://pypi.org/simple uv | ||
| - name: Check the tag names the version being built | ||
| run: | | ||
| version=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml) | ||
| [ "v${version}" = "${GITHUB_REF_NAME}" ] || { echo "::error::tag ${GITHUB_REF_NAME}, but pyproject.toml is at ${version}"; exit 1; } | ||
| - name: Build agentenv-framework-protocol | ||
| run: uv build --no-sources packages/agentenv-protocol --out-dir dist | ||
| - name: Check its metadata renders | ||
| run: uvx --index-url https://pypi.org/simple twine check --strict dist/* | ||
| - name: Publish agentenv-framework-protocol | ||
| run: uv publish --trusted-publishing always --check-url https://pypi.org/simple/ dist/* | ||
|
|
||
| framework: | ||
| needs: protocol | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| environment: pypi | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install uv from public PyPI | ||
| run: python -m pip install --quiet --index-url https://pypi.org/simple uv | ||
| - name: Build agentenv-framework, pinned to this release's agentenv-framework-protocol | ||
| run: | | ||
| protocol=$(sed -n 's/^version = "\(.*\)"/\1/p' packages/agentenv-protocol/pyproject.toml) | ||
| # Only the quoted requirement: the directory name also appears in the sdist include list and the uv | ||
| # workspace members, and the bare name keys [tool.uv.sources]; none of those may be rewritten. | ||
| sed -i "s/\"agentenv-framework-protocol[^\"]*\"/\"agentenv-framework-protocol==${protocol}\"/" pyproject.toml | ||
| grep -q "\"agentenv-framework-protocol==${protocol}\"" pyproject.toml | ||
| uv build --no-sources --out-dir dist | ||
| - name: Check its metadata renders | ||
| run: uvx --index-url https://pypi.org/simple twine check --strict dist/* | ||
| - name: Publish agentenv-framework | ||
| run: uv publish --trusted-publishing always --check-url https://pypi.org/simple/ dist/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each release installs the latest
uvand fetchestwinewithout a version pin. A later tool update could break the checks or upload even when the release code has not changed. Pin both to versions tested with this workflow.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!