From 5a214b80d9591d66b6c248ae41d34792cc5ae201 Mon Sep 17 00:00:00 2001 From: Aleksandr Fedorov Date: Tue, 1 Jul 2025 17:08:29 +0300 Subject: [PATCH] ci: added create-tag.yml and run release on create tag --- .github/workflows/create-tag.yml | 27 +++++++++++++++++++++++++++ .github/workflows/release.yml | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/create-tag.yml diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml new file mode 100644 index 00000000..94f338d1 --- /dev/null +++ b/.github/workflows/create-tag.yml @@ -0,0 +1,27 @@ +name: Create Tag + +on: + push: + branches: [master] + paths-ignore: + - '.github/**' + - '**/AUTHORS.md' + - '**/LICENSE' + - '**/README.md' + +jobs: + create-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Get Info + run: | + echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT + id: info + - name: Create Tag + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + git tag -a 'v${{ steps.info.outputs.version }}' -m 'Release/v${{ steps.info.outputs.version }}' + git push origin 'v${{ steps.info.outputs.version }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20099b14..cfa586c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,8 @@ name: Release on: push: - branches: [master] + tags: + - 'v*' permissions: contents: write