Skip to content

Commit

Permalink
Add github action workflow that creates tags
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz committed Aug 16, 2024
1 parent 112e90e commit e4fcb54
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e4fcb54

Please sign in to comment.