From df74355e1176258dda18f8cf235e2ad1f0508178 Mon Sep 17 00:00:00 2001 From: Daniil Ermolaev Date: Fri, 11 Oct 2024 04:55:45 +0500 Subject: [PATCH] New version CI/CD --- .github/workflows/version.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index bbb3b47..6b847b9 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -18,12 +18,18 @@ jobs: run: | COMMIT_COUNT=$(git rev-list --count HEAD) LAST_COMMIT_HASH=$(git rev-parse HEAD) # Получаем полный хеш - echo "total_commits=$COMMIT_COUNT" >> $GITHUB_ENV + echo "commit_count=$COMMIT_COUNT" >> $GITHUB_ENV echo "last_commit_hash=$LAST_COMMIT_HASH" >> $GITHUB_ENV - name: Create VERSION file run: | - echo "1.7.7_${{ env.last_commit_hash }}" > VERSION + # Формируем версию + MAJOR=$((commit_count / 100)) + MINOR=$(( (commit_count / 10) % 10 )) + PATCH=$((commit_count % 10)) + VERSION="${MAJOR}.${MINOR}.${PATCH}_${{ env.last_commit_hash }}" + + echo "$VERSION" > VERSION - name: Commit and push changes run: |