From ee315c3ff17733d95e241427a19482022b6291c2 Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Tue, 26 Aug 2025 18:19:52 +0200 Subject: [PATCH 1/7] micro commit to check build script --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 520f76a..6dd96f5 100644 --- a/README.md +++ b/README.md @@ -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. From 8b9a4be3336432e9a741da785c8c06110ba65e9e Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Tue, 26 Aug 2025 18:27:31 +0200 Subject: [PATCH 2/7] used prev version from package.json but not a tag --- .github/workflows/check-version.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-version.yml b/.github/workflows/check-version.yml index 6c414a9..91101f7 100644 --- a/.github/workflows/check-version.yml +++ b/.github/workflows/check-version.yml @@ -12,21 +12,27 @@ 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" + 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" + 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 From 3d14434f683545f4a8b05157107a14e42faee128 Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Tue, 26 Aug 2025 18:31:21 +0200 Subject: [PATCH 3/7] version increment --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 126fd7d..81ad2c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.baltin.fbt", - "version": "0.5.0", + "version": "0.5.1", "displayName": "FunctionalBT", "description": "Functional Behavior Tree Design Pattern Implementation", "unity": "2019.3", From 51d720dc4056e7fee9a01a0d1c0ef982511bfc9e Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Tue, 26 Aug 2025 18:35:01 +0200 Subject: [PATCH 4/7] script improved --- .github/workflows/check-version.yml | 9 +++++++-- package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-version.yml b/.github/workflows/check-version.yml index 91101f7..0dbacd9 100644 --- a/.github/workflows/check-version.yml +++ b/.github/workflows/check-version.yml @@ -18,8 +18,13 @@ jobs: - name: Get previous version from base branch run: | echo "Base branch (destination of PR): $GITHUB_BASE_REF" - 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" + 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 current version from PR diff --git a/package.json b/package.json index 81ad2c4..91849d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.baltin.fbt", - "version": "0.5.1", + "version": "0.5.2", "displayName": "FunctionalBT", "description": "Functional Behavior Tree Design Pattern Implementation", "unity": "2019.3", From baa09b5fa7d15cde70ebfd6119e61ab74f329147 Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Tue, 26 Aug 2025 18:41:43 +0200 Subject: [PATCH 5/7] create a tag after merge --- .github/workflows/tag-release.yml | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/tag-release.yml diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 0000000..01fe358 --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -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 From 7ec6b5f60535c2c28a4d0d65b5038fc3063679a3 Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Tue, 26 Aug 2025 18:43:57 +0200 Subject: [PATCH 6/7] version incremented --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 91849d1..ebff2cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.baltin.fbt", - "version": "0.5.2", + "version": "0.5.3", "displayName": "FunctionalBT", "description": "Functional Behavior Tree Design Pattern Implementation", "unity": "2019.3", From 58338195d22032e5b9315a0c3321cd106cd53454 Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Tue, 26 Aug 2025 18:49:21 +0200 Subject: [PATCH 7/7] Empty version increment to check github actions --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ebff2cb..49cf6b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.baltin.fbt", - "version": "0.5.3", + "version": "0.5.4", "displayName": "FunctionalBT", "description": "Functional Behavior Tree Design Pattern Implementation", "unity": "2019.3",