Skip to content

fix: fix release

fix: fix release #2

Workflow file for this run

name: Tag and Release

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 29, Col: 14): Unexpected symbol: 'latest_tag#v'. Located at position 23 within expression: steps.get_tag.outputs.latest_tag#v
on:
workflow_dispatch: # Manual trigger
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: Get latest tag
id: get_tag
run: |
latest_tag=$(git describe --tags --abbrev=0 || echo "v0.0.0")
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Bump version and create new tag
id: new_tag
run: |
IFS='.' read -r major minor patch <<< "${{ steps.get_tag.outputs.latest_tag#v }}"
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 with git-cliff
uses: orhun/git-cliff-action@v2
with:
config: cliff.toml
args: -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 }}