-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09d65c8
commit dacb120
Showing
1 changed file
with
2 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,39 +60,32 @@ jobs: | |
- name: Generate Version | ||
run: | | ||
cd VortexEngine # Move into the repository directory | ||
# Get the latest tag (ensures it's a proper version number) | ||
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0") | ||
# Count commits since the tag | ||
COUNT=$(git rev-list $TAG..HEAD --count) | ||
# Ensure TAG is in X.Y.Z format | ||
if [[ ! $TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Invalid TAG format: $TAG. Using default 0.0.0" | ||
TAG="0.0.0" | ||
fi | ||
# Extract MAJOR, MINOR, PATCH | ||
IFS='.' read -r MAJOR MINOR PATCH <<< "$TAG" | ||
# Ensure variables are integers | ||
MAJOR=$((MAJOR + 0)) | ||
MINOR=$((MINOR + 0)) | ||
PATCH=$((PATCH + 0)) | ||
COUNT=$((COUNT + 0)) | ||
# Calculate new PATCH version | ||
NEW_PATCH=$((PATCH + COUNT)) | ||
# Construct the final version | ||
VERSION="$MAJOR.$MINOR.$NEW_PATCH" | ||
# cd back out to generate the version | ||
cd - | ||
# Output version to version.js | ||
echo "export const VERSION = '$VERSION';" > version.js | ||
echo "Generated Version: $VERSION" | ||
- name: Setup SSH Agent | ||
uses: webfactory/[email protected] | ||
with: | ||
|