Skip to content

Fix filepath

Fix filepath #7

Workflow file for this run

name: Bump Version on Tag
on:
push:
tags:
- "v*"
jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Git
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Extract version from tag
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_ENV"
- name: Bump version in pyproject.toml and conf.py
run: |
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
sed -i "s/^release = \".*\"/release = \"$VERSION\"/" docs/source/conf.py
sed -i "s/^version = \".*\"/version = \"${VERSION%.*}\"/" docs/source/conf.py
- name: Commit changes
run: |
git checkout -b version-bump-v${VERSION}
git commit -am "Auto bump version files to ${VERSION}"
git push origin version-bump-v${VERSION}
- name: Create PR
id: create_pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Bump version to v${{ env.VERSION }}"
body: "Automated version bump for tag `${{ github.ref_name }}`."
branch: version-bump-v${{ env.VERSION }}
base: main
draft: false
delete-branch: true
- name: Auto approve
uses: hmarr/auto-approve-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
merge-method: squash