-
Notifications
You must be signed in to change notification settings - Fork 0
Require GitVersion in all environments and unify build process #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
56b7280
3a8fc94
27952b5
9f4e46f
6f989f7
d63f9a7
9a9471e
e7814e9
1892c85
3de85a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,116 +3,29 @@ import { join } from 'path'; | |||||||||||||||||||||||||
| import { execSync } from 'child_process'; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| function getGitVersion(): string { | ||||||||||||||||||||||||||
| // First, check if GitVersion environment variables are available (from CI) | ||||||||||||||||||||||||||
| // Check GitVersion environment variables (from CI) | ||||||||||||||||||||||||||
| const envSemVer = process.env.GITVERSION_SEMVER; | ||||||||||||||||||||||||||
| const envFullSemVer = process.env.GITVERSION_FULLSEMVER; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if (envSemVer) { | ||||||||||||||||||||||||||
| console.log(`Using GitVersion from environment: ${envSemVer}`); | ||||||||||||||||||||||||||
| return envSemVer; | ||||||||||||||||||||||||||
| if (envSemVer || envFullSemVer) { | ||||||||||||||||||||||||||
| const version = envSemVer || envFullSemVer || ''; | ||||||||||||||||||||||||||
| console.log(`Using GitVersion from environment: ${version}`); | ||||||||||||||||||||||||||
| return version; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| if (envSemVer || envFullSemVer) { | |
| const version = envSemVer || envFullSemVer || ''; | |
| console.log(`Using GitVersion from environment: ${version}`); | |
| return version; | |
| if ((envSemVer && envSemVer.trim()) || (envFullSemVer && envFullSemVer.trim())) { | |
| const version = envSemVer && envSemVer.trim() ? envSemVer.trim() : envFullSemVer && envFullSemVer.trim() ? envFullSemVer.trim() : null; | |
| if (!version) { | |
| // Both variables are set but empty/whitespace, fall through to CLI | |
| } else { | |
| console.log(`Using GitVersion from environment: ${version}`); | |
| return version; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Test with the version injection... Fix things so that we can build the same in all environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the
build:no-versioncommand and updated the test script to usenpm run buildwith version injection. Now all environments (CI, local development, and testing) use exactly the same build process with GitVersion. All 749 tests pass with the unified build approach. Commit: 1892c85