From 62675ea26f5a555e9643b33b83ac2010dcafd3c5 Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Fri, 16 Aug 2024 17:31:22 -0500 Subject: [PATCH] Add github action workflow that creates tags --- .github/workflows/create-tag.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 0000000000..10bf2be81d --- /dev/null +++ b/.github/workflows/create-tag.yml @@ -0,0 +1,25 @@ +name: Create tag for release + +on: + pull_request: + types: + - closed + +jobs: + create-tag: + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && startsWith(github.event.pull_request.head.ref, 'bump-version') + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Extract version + uses: dtolnay/rust-toolchain@stable + run: | + echo "version=$(cargo pkgid -p bindgen | cut -d '#' -f 2)" >> $GITHUB_ENV + + - name: Create tag + run: | + TAG_NAME="v${{ env.VERSION }}" + git tag $TAG_NAME + git push origin $TAG_NAME