Bump version to 1.12.0 #16
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: Release gate & publish | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| env: | |
| PACKAGE_DIR: tesla_fleet_api | |
| PYTHON_VERSION: "3.13" | |
| PYPI_PROJECT_URL: https://pypi.org/p/tesla_fleet_api | |
| ENVIRONMENT_NAME: pypi | |
| jobs: | |
| gate: | |
| name: Full CI gate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| run: uv python install ${{ env.PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: uv sync --locked --python ${{ env.PYTHON_VERSION }} | |
| - name: Ruff | |
| run: uv run ruff check ${{ env.PACKAGE_DIR }} tests | |
| - name: Pyright | |
| run: uv run pyright ${{ env.PACKAGE_DIR }} | |
| - name: Pytest | |
| run: uv run pytest tests -q | |
| - name: Build | |
| run: uv build | |
| - name: Check distribution | |
| run: uvx twine check dist/* | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| name: Publish distribution to PyPI | |
| needs: gate | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/tesla_fleet_api | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| github-release: | |
| name: Upload distribution to GitHub Release | |
| needs: publish-to-pypi | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # mandatory for making GitHub Releases | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: >- | |
| gh release create | |
| '${{ github.ref_name }}' | |
| --repo '${{ github.repository }}' | |
| --generate-notes | |
| - name: Upload artifacts to GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: >- | |
| gh release upload | |
| '${{ github.ref_name }}' dist/** | |
| --repo '${{ github.repository }}' |