Skip to content

Merge pull request #1 from includeamin/init #1

Merge pull request #1 from includeamin/init

Merge pull request #1 from includeamin/init #1

Workflow file for this run

name: Tag and Release
on:
push:
branches:
- main
jobs:
tag-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for full git history
- name: Set up Git user
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Install git-cliff
run: |
curl -sSL https://github.com/orhun/git-cliff/releases/latest/download/git-cliff-linux-x86_64.tar.gz | tar -xz
sudo mv git-cliff /usr/local/bin/
- name: Get latest tag
id: get_tag
run: |
latest_tag=$(git describe --tags --abbrev=0)
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Bump version and create new tag
id: new_tag
run: |
# Example: bump patch version (customize as needed)
IFS='.' read -r major minor patch <<< "${{ steps.get_tag.outputs.latest_tag }}"
new_tag="v$major.$minor.$((patch + 1))"
git tag "$new_tag"
git push origin "$new_tag"
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
- name: Generate changelog
run: |
git-cliff -c cliff.toml -t ${{ steps.new_tag.outputs.new_tag }} -o CHANGELOG.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.new_tag.outputs.new_tag }}
name: Release ${{ steps.new_tag.outputs.new_tag }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}