feat[clients]: upgrade guard (#19) #37
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 Dev Version | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| - '**.md' | |
| jobs: | |
| publish-dev: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Get latest tag version | |
| id: get_version | |
| run: | | |
| LATEST_TAG=$(git describe --tags --abbrev=0) | |
| CLEAN_VERSION=${LATEST_TAG#v} | |
| echo "version=${CLEAN_VERSION}.dev$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT | |
| echo "Latest tag version: ${CLEAN_VERSION}" | |
| - name: Update version in pyproject.toml | |
| run: | | |
| sed -i "s/version = .*/version = \"${{ steps.get_version.outputs.version }}\"/" pyproject.toml | |
| echo "New version: ${{ steps.get_version.outputs.version }}" | |
| - name: Build package | |
| run: python -m build | |
| - name: Verify package | |
| run: twine check dist/* | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| run: twine upload dist/* |