Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/check-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,32 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get last Git tag
id: tag
- name: Get previous version from base branch
run: |
LAST_TAG=$(git describe --tags --abbrev=0 || echo "v0.0.0")
echo "LAST_TAG=$LAST_TAG" >> $GITHUB_ENV
echo "Base branch (destination of PR): $GITHUB_BASE_REF"
if git show origin/${GITHUB_BASE_REF}:package.json > /dev/null 2>&1; then
VERSION_PREV=$(git show origin/${GITHUB_BASE_REF}:package.json | grep '"version"' | head -1 | sed -E 's/.*"version": *"([^"]+)".*/\1/')
echo "Previous version from base branch: $VERSION_PREV"
else
VERSION_PREV="0.0.0"
echo "No package.json in base branch, using default version: $VERSION_PREV"
fi
echo "VERSION_PREV=$VERSION_PREV" >> $GITHUB_ENV

- name: Get package.json version
- name: Get current version from PR
run: |
VERSION=$(grep '"version"' package.json | head -1 | sed -E 's/.*"version": *"([^"]+)".*/\1/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
VERSION_CUR=$(grep '"version"' package.json | head -1 | sed -E 's/.*"version": *"([^"]+)".*/\1/')
echo "Current version in PR: $VERSION_CUR"
echo "VERSION_CUR=$VERSION_CUR" >> $GITHUB_ENV

- name: Check version increment
run: |
if [ "$VERSION" == "${LAST_TAG#v}" ]; then
echo "Version not incremented! Last tag: $LAST_TAG, package.json: $VERSION"
if [ "$VERSION_CUR" == "$VERSION_PREV" ]; then
echo "Version not incremented! Previous: $VERSION_PREV, current: $VERSION_CUR"
exit 1
else
echo "Version increment check passed: $VERSION_PREV → $VERSION_CUR"
fi
35 changes: 35 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tag release

on:
push:
branches:
- main
- test

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get package.json version
run: |
VERSION=$(grep '"version"' package.json | head -1 | sed -E 's/.*"version": *"([^"]+)".*/\1/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Tag to create: v$VERSION"

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Create Git tag
run: |
# проверяем, есть ли уже такой тег
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Tag v$VERSION already exists, skipping creation."
else
git tag -a "v$VERSION" -m "Release v$VERSION"
git push origin "v$VERSION"
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This package includes the full source code of Functional Behavior Tree (FBT) par
1. **Clear and Concise Behavior Tree Definition**
Behavior trees are defined directly in code using functions calls and lambda expressions, resulting in clear and compact logic.

2. **Ease of Debugging**
2. **Ease Debug**
The tree definition and execution code are the same, which means you can place breakpoints inside any anonymous delegate, and they will work correctly.
No special complex "behaviour tree debugger" is required, you will use your favorite C# IDE.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.baltin.fbt",
"version": "0.5.0",
"version": "0.5.4",
"displayName": "FunctionalBT",
"description": "Functional Behavior Tree Design Pattern Implementation",
"unity": "2019.3",
Expand Down