Skip to content

move frontend into client/web #10

move frontend into client/web

move frontend into client/web #10

name: Update Version and Release
on:
push:
branches:
- main
paths:
- "CHANGELOG.md"
permissions:
contents: write
jobs:
update-version:
name: Update API Version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Extract latest version from CHANGELOG.md
id: get_version
run: |
if VERSION=$(grep -oP '\\[\\K[0-9]+\\.[0-9]+\\.[0-9]+' CHANGELOG.md | head -1); then
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Found version: $VERSION"
else
echo "Error: Failed to extract version from CHANGELOG.md"
exit 1
fi
- name: Update version in cmd/api/main.go
run: |
sed -i "s/const version = \".*\"/const version = \"${{ steps.get_version.outputs.VERSION }}\"/" cmd/api/main.go
echo "Updated version in cmd/api/main.go to ${{ steps.get_version.outputs.VERSION }}"
- name: Commit and push changes
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add cmd/api/main.go
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update API version to ${{ steps.get_version.outputs.VERSION }}"
git push
echo "Successfully pushed version update"
fi