Publish to PyPI #7
Workflow file for this run
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
| name: Publish to PyPI | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Push events to tags matching v*, e.g., v1.0.0, v2.0.0.beta | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| build: | |
| name: Build distribution 📦 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Build package | |
| run: uv build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| name: >- | |
| Publish Python 🐍 distribution 📦 to PyPI | |
| if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/agentcrew-ai | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Publish distribution 📦 to PyPI | |
| run: uv publish | |
| env: | |
| UV_TRUSTED_PUBLISHER: true | |
| # publish-to-testpypi: | |
| # name: Publish Python 🐍 distribution 📦 to TestPyPI | |
| # needs: | |
| # - build | |
| # runs-on: ubuntu-latest | |
| # if: startsWith(github.ref, 'refs/tags/') | |
| # | |
| # environment: | |
| # name: testpypi | |
| # url: https://test.pypi.org/p/AgentCrew | |
| # | |
| # permissions: | |
| # id-token: write # IMPORTANT: mandatory for trusted publishing | |
| # | |
| # steps: | |
| # - name: Download all the dists | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: python-package-distributions | |
| # path: dist/ | |
| # | |
| # - name: Install uv | |
| # uses: astral-sh/setup-uv@v5 | |
| # | |
| # - name: Publish distribution 📦 to TestPyPI | |
| # run: uv publish --repository testpypi | |
| # env: | |
| # UV_TRUSTED_PUBLISHER: true |