Skip to content

Commit

Permalink
New version CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBLCKLPTN committed Oct 10, 2024
1 parent 49efcdd commit df74355
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit df74355

Please sign in to comment.