Merge pull request #365 from dwash96/v0.93.3 #95
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: PyPI Release (cecli + aider-ce) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| jobs: | |
| publish_cecli: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Verify pyproject.toml is cecli-dev package | |
| run: | | |
| # Check that pyproject.toml has name = "cecli-dev" | |
| if ! grep -q 'name = "cecli-dev"' pyproject.toml; then | |
| echo "ERROR: pyproject.toml does not have name = 'cecli-dev'" | |
| exit 1 | |
| fi | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build setuptools wheel twine importlib-metadata==7.2.1 | |
| - name: Build and publish cecli | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| python -m build | |
| twine upload dist/* | |
| publish_aider_ce: | |
| runs-on: ubuntu-latest | |
| needs: publish_cecli | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Copy shim.pyproject.toml for aider-ce build | |
| run: | | |
| # Backup current pyproject.toml (which is cecli) | |
| if [ -f "pyproject.toml" ]; then | |
| mv pyproject.toml pyproject.toml.backup | |
| fi | |
| # Copy shim.pyproject.toml to pyproject.toml | |
| cp shim.pyproject.toml pyproject.toml | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build setuptools wheel twine importlib-metadata==7.2.1 | |
| - name: Build and publish aider-ce (shim package) | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| python -m build | |
| twine upload dist/* | |
| - name: Restore original pyproject.toml | |
| run: | | |
| # Restore original pyproject.toml (cecli) if it was backed up | |
| if [ -f "pyproject.toml.backup" ]; then | |
| mv pyproject.toml.backup pyproject.toml | |
| fi |