Skip to content

Commit ac7af63

Browse files
committed
fix: update desktop build workflow to detect version changes in constants file
- Change version detection from package.json to src/constants/version.ts - Extract version from APP_VERSION constant for release naming - This aligns with the automated versioning system that updates version constants
1 parent 441b9ea commit ac7af63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/desktop-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ jobs:
8484
- name: Check if version changed
8585
id: version-check
8686
run: |
87-
if git diff HEAD~1 HEAD --name-only | grep -q "package\.json" && git diff HEAD~1 HEAD | grep -E "^\+.*version.*[0-9]+\.[0-9]+\.[0-9]+"; then
88-
VERSION=$(node -p "require('./package.json').version")
87+
if git diff HEAD~1 HEAD --name-only | grep -q "src/constants/version\.ts" && git diff HEAD~1 HEAD | grep -E "^\+.*APP_VERSION.*[0-9]+\.[0-9]+\.[0-9]+"; then
88+
VERSION=$(node -p "const fs = require('fs'); const content = fs.readFileSync('src/constants/version.ts', 'utf8'); const match = content.match(/APP_VERSION = '([^']+)'/); match ? match[1] : '0.0.0'")
8989
echo "version-changed=true" >> $GITHUB_OUTPUT
9090
echo "new-version=v$VERSION" >> $GITHUB_OUTPUT
9191
else

0 commit comments

Comments
 (0)