From d8aadf4159d85207cabecc9f32ac3f8c16eb815a Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:21:20 -0500 Subject: [PATCH] Create on_release.yaml --- .github/workflows/on_release.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/on_release.yaml diff --git a/.github/workflows/on_release.yaml b/.github/workflows/on_release.yaml new file mode 100644 index 0000000..453c2a0 --- /dev/null +++ b/.github/workflows/on_release.yaml @@ -0,0 +1,16 @@ +on: + release: + types: [published] + +jobs: + change_version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Update version in pyproject.toml + run: | + tag_name=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//') + sed -i "s/version = .*/version = '${tag_name}'/" pyproject.toml + git add pyproject.toml + git commit -m "Update version to ${tag_name}" + git push