From 65c6d309217d06871c800770bca938f1931a8416 Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Sat, 30 Aug 2025 11:57:14 +0200 Subject: [PATCH 1/2] fixed script for release --- .github/workflows/create-release.yml | 40 ++++++++++++++++++++++++++++ .github/workflows/tag-release.yml | 35 ------------------------ 2 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/create-release.yml delete mode 100644 .github/workflows/tag-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..544e70e --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,40 @@ +name: Create Release + +on: + push: + branches: + - main + - test + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Get package.json version + run: | + VERSION=$(grep '"version"' package.json | head -1 | sed -E 's/.*"version": *"([^"]+)".*/\1/') + if [ -z "$VERSION" ]; then + echo "Version not found in package.json" >&2 + exit 1 + fi + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Release version: v$VERSION" + + - name: Create GitHub Release + uses: actions/create-release@v1 + with: + tag_name: v${{ env.VERSION }} + release_name: Release v${{ env.VERSION }} + draft: false + prerelease: ${{ github.ref == 'refs/heads/test' }} # на ветке test будут пререлизы + body: | + Changes in this release: + - TODO: перечисли изменения или сгенерируй changelog + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml deleted file mode 100644 index 01fe358..0000000 --- a/.github/workflows/tag-release.yml +++ /dev/null @@ -1,35 +0,0 @@ -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 d96605de637835a1db73e5aa6422cd810681207c Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Sat, 30 Aug 2025 12:01:29 +0200 Subject: [PATCH 2/2] version increment --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a9d4f3..5fb6e76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.baltin.fbt", - "version": "0.6.0", + "version": "0.6.1", "displayName": "FunctionalBT", "description": "Functional Behavior Tree Design Pattern Implementation", "unity": "2021.2",