v0.2.6 #9
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: Latest Release | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| publish-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: release | |
| outputs: | |
| release_body: ${{ steps.git-cliff.outputs.content }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - uses: pdm-project/setup-pdm@v3 | |
| name: Set up PDM | |
| with: | |
| python-version: "3.12" | |
| cache: true | |
| - name: Build package | |
| run: pdm build | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| - name: Generate a changelog | |
| uses: orhun/git-cliff-action@main | |
| id: git-cliff | |
| with: | |
| config: pyproject.toml | |
| args: -vv --latest --strip header | |
| - name: Commit changelog | |
| run: | | |
| git checkout main | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| set +e | |
| git add docs/changelog.rst | |
| git commit -m "release: update changelog" | |
| git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git main |