Merge pull request #16 from pratikkumar-mohite/pm/documentation #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Releases | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Git | |
run: | | |
git config --local user.email "mohite770.pm@gmail.com" | |
git config --local user.name "Pratikkumar Mohite" | |
- name: Create and push Git tag | |
run: | | |
# Fetch the latest tags | |
git fetch --tags | |
# Get the latest tag version | |
latest_tag=$(git describe --tags --always $(git rev-list --tags --max-count=1)) | |
echo $latest_tag | |
# Parse the version components (assuming semantic versioning) | |
IFS='.' read -r major minor patch <<< "$latest_tag" | |
# Increment the patch version | |
new_patch=$((patch + 1)) | |
# Create a new tag | |
new_tag="${major}.${minor}.${new_patch}" | |
git tag "${new_tag}" | |
# Push the new tag to the repository | |
git push origin "${new_tag}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} |