semantic-release test #7
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: Semantic Release | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: { contents: write, id-token: write } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine "python-semantic-release==7.34.0" | |
| - name: Debug tags & version | |
| run: | | |
| echo "pyproject version:"; grep '^version' pyproject.toml | |
| echo "latest tag:"; git describe --tags --abbrev=0 || echo "no tags" | |
| echo "all tags:"; git tag -l | |
| - name: Run Semantic Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TWINE_USERNAME: "__token__" | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| run: semantic-release publish |