Skip to content

improve version update #13

improve version update

improve version update #13

Workflow file for this run

name: Upload Python Package
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: set up Poetry
uses: abatilo/actions-poetry@v2
- name: Get version
id: get_version
run: echo "VERSION=$(echo ${GITHUB_REF/refs\/tags\//})" >> $GITHUB_ENV
- name: Set version
run: |
VERSION=${{ env.VERSION }}
poetry version ${VERSION#v}
- name: publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: poetry publish --build
- name: Create GitHub release entry
uses: softprops/action-gh-release@v1
id: create_release
with:
draft: false
prerelease: false
name: ${{ env.VERSION }}
tag_name: ${{ env.VERSION }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add pyproject.toml
git commit -m "Update pyproject.toml"
git push origin HEAD:main