Skip to content

Commit

Permalink
Create new-tag.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea authored Dec 25, 2024
1 parent ff112ba commit 88a050e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/new-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create Tag on Commit to Main

on:
push:
branches:
- main

jobs:
create_tag:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Git
uses: actions/setup-git@v2

- name: Get the current version
id: version
run: |
VERSION=$(git describe --tags --abbrev=0)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create a new tag
run: |
NEW_VERSION=$(echo ${{ env.VERSION }} | awk -F. -v OFS=. '{$NF++;print}')
echo "New version: $NEW_VERSION"
git tag $NEW_VERSION
git push origin $NEW_VERSION
- name: Push the tag to the repository
run: |
git push origin --tags

0 comments on commit 88a050e

Please sign in to comment.