ci: update documentation workflow to Python 3.14 #4
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: Continuous Deployment | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| release: | ||
| types: [published] | ||
| jobs: | ||
| generate-changelog: | ||
| name: Generate changelog | ||
| runs-on: ubuntu-22.04 | ||
| permissions: | ||
| contents: write | ||
| outputs: | ||
| release_body: ${{ steps.git-cliff.outputs.content }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Generate a changelog | ||
| uses: orhun/git-cliff-action@main | ||
| id: git-cliff | ||
| with: | ||
| config: pyproject.toml | ||
| args: -vv --latest --strip header | ||
| - name: Fetch latest main | ||
| run: git fetch origin main | ||
| - name: Create worktree for changelog | ||
| run: git worktree add worktree-changelog origin/main | ||
| - name: Generate changelog in worktree | ||
| working-directory: worktree-changelog | ||
| uses: orhun/git-cliff-action@main | ||
| with: | ||
| config: pyproject.toml | ||
| args: -vv --latest --strip header --output docs/changelog.rst | ||
| - name: Commit and push changelog | ||
| working-directory: worktree-changelog | ||
| run: | | ||
| git config user.name 'github-actions[bot]' | ||
| git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
| git add docs/changelog.rst | ||
| if git diff --staged --quiet; then | ||
| echo "No changes to commit" | ||
| else | ||
| git commit -m "docs: update changelog [skip ci]" | ||
| git push origin HEAD:main | ||
| fi | ||
| - name: Cleanup worktree | ||
| if: always() | ||
| run: git worktree remove worktree-changelog || true | ||