fix(codegen): preserve regenerated response aliases (#854) #516
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: Release Please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: googleapis/release-please-action@v5 | |
| id: release | |
| with: | |
| release-type: python | |
| - name: Checkout release PR | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Normalize release PR pyproject prerelease version | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| env: | |
| RELEASE_PR_BRANCH: release-please--branches--${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| git fetch origin "${RELEASE_PR_BRANCH}:${RELEASE_PR_BRANCH}" | |
| git switch "${RELEASE_PR_BRANCH}" | |
| python3 scripts/normalize_pyproject_prerelease.py pyproject.toml | |
| if git diff --quiet -- pyproject.toml; then | |
| echo "pyproject.toml already uses a PEP 440-compatible version" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add pyproject.toml | |
| git commit -m "chore: normalize prerelease version to PEP 440" | |
| git push origin "HEAD:${RELEASE_PR_BRANCH}" | |
| # Publish to PyPI when a release is created | |
| - name: Checkout | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: actions/checkout@v6 | |
| - name: Setup Python | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install build dependencies | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build package | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: python -m build | |
| - name: Publish to PyPI | |
| if: ${{ steps.release.outputs.release_created }} | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPY_API_TOKEN }} | |
| run: twine upload dist/* |