Skip to content

package

package #5

Workflow file for this run

name: Tag New Version
on:
push:
branches:
- main
permissions:
contents: write
jobs:
tag_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extract version from pyproject.toml
id: extract_version
run: |
VERSION=$(grep -E '^version\s*=' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create and push tag
env:
VERSION: ${{ env.VERSION }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v$VERSION" -m "Version $VERSION"
git push -f origin "v$VERSION"