Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f46d6972
authored
Oct 05, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: enhance versioning logic in electron-build.yml for semver compliance
parent
7f274f69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
.github/workflows/electron-build.yml
+23
-0
No files found.
.github/workflows/electron-build.yml
View file @
f46d6972
...
@@ -66,6 +66,29 @@ jobs:
...
@@ -66,6 +66,29 @@ jobs:
cd electron
cd electron
VERSION=$(git describe --tags)
VERSION=$(git describe --tags)
VERSION=${VERSION#v} # Remove 'v' prefix if present
VERSION=${VERSION#v} # Remove 'v' prefix if present
# Convert to valid semver: take first 3 components and convert rest to prerelease format
# e.g., 0.9.0.9.1-50-g7074ea2e -> 0.9.0-dev.9.1.50.g7074ea2e
if [[ $VERSION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$ ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
REST=${BASH_REMATCH[4]}
VERSION="$MAJOR.$MINOR.$PATCH"
# If there's extra content, parse and convert to prerelease format
if [[ -n "$REST" ]]; then
if [[ $REST =~ ^(\..*)?(-[0-9]+-g[0-9a-f]+)$ ]]; then
EXTRA=${BASH_REMATCH[1]}
GIT_SUFFIX=${BASH_REMATCH[2]}
VERSION="$VERSION-dev"
[[ -n "$EXTRA" ]] && VERSION="$VERSION${EXTRA//./.}"
[[ -n "$GIT_SUFFIX" ]] && VERSION="$VERSION${GIT_SUFFIX//-/.}"
else
VERSION="$VERSION-dev${REST//./.}"
fi
fi
fi
npm version $VERSION --no-git-tag-version --allow-same-version
npm version $VERSION --no-git-tag-version --allow-same-version
-
name
:
Install Electron dependencies
-
name
:
Install Electron dependencies
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment