Fix PyPI package name to use underscores #3
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: Tag Release | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: [main] | |
| jobs: | |
| tag-release: | |
| if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'version-bump') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| 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.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox twine wheel setuptools | |
| - name: Get version from file | |
| id: get_version | |
| run: | | |
| version=$(grep '^current_version' .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ') | |
| echo "version=${version}" >> "$GITHUB_OUTPUT" | |
| - name: Create and push tag | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release version ${{ steps.get_version.outputs.version }}" | |
| git push origin "v${{ steps.get_version.outputs.version }}" | |
| - name: Make release script executable | |
| run: chmod +x release.sh | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: ./release.sh |