-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix version build number in DEB and RPM package info (#5140)
### Summary - addresses #5159 - related to #1373 - a follow-up to #5072 to fix up the DEB and RPM package info build number ### Changes - The `positronBuildNumber` from the package.json file will always be zero -- instead, we need to use the calculated build number from show-version.js when possible. - We are already using the calculated build number in a few places, but a few were missing, resulting in a build number of zero `0` in the DEB and RPM package info. - The `positronBuildVersion` variable is now in a separate util file, so the value can be used across the gulpfiles. ### QA Notes I've checked the version output of the DEB on Ubuntu 24 (x86_64) and the RPM on Fedora 40 (arm). #### DEB 1. Run `dpkg --info <POSITRON_BINARY>.deb` 2. Confirm the Version field in the output shows `<POSITRON_VERSION>+<BUILD_NUMBER>-<LINUX_REVISION>` Sample Output: ``` <SOME_INITIAL_INFO> Package: positron Version: 2024.11.0+999-1729709839 <REST_OF_INFO> ``` #### RPM 1. Run `rpm -qi <POSITRON_BINARY>.rpm` 2. Confirm the Version field in the output shows `<POSITRON_VERSION>+<BUILD_NUMBER>` Sample Output: ``` Name : positron Version : 2024.11.0+999 <REST_OF_INFO> ```
- Loading branch information
1 parent
b283528
commit fa567b2
Showing
5 changed files
with
31 additions
and
23 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (C) 2024 Posit Software, PBC. All rights reserved. | ||
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
'use strict'; | ||
|
||
const child_process = require('child_process'); | ||
const path = require('path'); | ||
|
||
const REPO_ROOT = path.dirname(__dirname); | ||
|
||
/** | ||
* Get the build number for Positron. | ||
*/ | ||
const positronBuildNumber = | ||
process.env.POSITRON_BUILD_NUMBER ?? | ||
child_process.execSync(`node ${REPO_ROOT}/versions/show-version.js --build`).toString().trim(); | ||
exports.positronBuildNumber = positronBuildNumber; |