diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 31616fb..bc03fcf 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -29,6 +29,7 @@ extends: template: azure-pipelines/extension/pre-release.yml@templates parameters: ghCreateTag: false + standardizedVersioning: true l10nSourcePaths: ./src buildPlatforms: - name: Linux @@ -40,11 +41,6 @@ extends: - script: npm ci displayName: npm ci - - script: npm run updateBuildNumber - displayName: Update build number - env: - VSC_BUILD_ID: $(Build.BuildNumber) - - script: npm run esbuild-release displayName: Build diff --git a/build/azure-pipeline.stable.yml b/build/azure-pipeline.stable.yml index f099ba9..8b8004f 100644 --- a/build/azure-pipeline.stable.yml +++ b/build/azure-pipeline.stable.yml @@ -38,11 +38,6 @@ extends: npm_config_build_from_source: true VSC_VSCE_TARGET: $(vsceTarget) - - script: npm run updateBuildNumber - displayName: Update build number - env: - VSC_BUILD_ID: $(Build.BuildNumber) - - script: npm run esbuild-release displayName: Build diff --git a/build/updateBuildNumber.js b/build/updateBuildNumber.js deleted file mode 100644 index d3faa80..0000000 --- a/build/updateBuildNumber.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const fs = require('fs'); - - -/** - * For multi-platform builds We end up generating multiple VSIX in the same pipeline. - * As a result this runs multiple times in the same pipeline, - * and we can have different build numbers for different VSIX. - * - * On CI, we use the Azure Build Number to generate a unique build number. - * The Azure Build Number will contain the date time information of the current build time - */ -function getBuildDate() { - const vscBuildId = process.env.VSC_BUILD_ID || ''; - const buildParts = vscBuildId.split('_'); - if (buildParts.length >= 3) { - return new Date( - parseInt(buildParts[0].substring(0, 4), 10), - parseInt(buildParts[0].substring(4, 6), 10) - 1, - parseInt(buildParts[0].substring(6), 10), - parseInt(buildParts[1], 10), - parseInt(buildParts[2], 10) - ); - } else { - return new Date(); - } -} -function updateBuildNumber() { - // Edit the version number from the package.json - const packageJsonContents = fs.readFileSync('package.json', 'utf-8'); - const packageJson = JSON.parse(packageJsonContents); - - // Change version number - // 3rd part of version is limited to Max Int32 numbers (in VSC Marketplace). - // Hence build numbers can only be YYYY.MMM.2147483647 - // NOTE: For each of the following strip the first 3 characters from the build number. - // E.g. if we have build number of `build number = 3264527301, then take 4527301 - - // To ensure we can have point releases & insider builds, we're going with the following format: - // Insider & Release builds will be YYYY.MMM.100 - // When we have a hot fix, we update the version to YYYY.MMM.110 - // If we have more hot fixes, they'll be YYYY.MMM.120, YYYY.MMM.130, & so on. - - const versionParts = packageJson.version.split('.'); - // New build is of the form `DDDHHMM` (day of year, hours, minute) (7 digits, as out of the 10 digits first three are reserved for `100` or `101` for patches). - // Use date time for build, this way all subsequent builds are incremental and greater than the others before. - // Example build for 3Jan 12:45 will be `0031245`, and 16 Feb 8:50 will be `0470845` - const today = getBuildDate(); - const dayCount = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; - const dayOfYear = dayCount[today.getMonth()] + today.getDate() + 1; - const buildNumberSuffix = `${dayOfYear.toString().padStart(3, '0')}${(today.getHours() + 1) - .toString() - .padStart(2, '0')}${today.getMinutes().toString().padStart(2, '0')}`; - const buildNumber = `${versionParts[2].substring(0, 3)}${buildNumberSuffix}`; - const newVersion = - versionParts.length > 1 ? `${versionParts[0]}.${versionParts[1]}.${buildNumber}` : packageJson.version; - packageJson.version = newVersion; - console.log('Build Number', newVersion); - // Write back to the package json - fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); -} - -updateBuildNumber() diff --git a/gulpfile.js b/gulpfile.js index 96b5e69..c630d69 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -293,69 +293,6 @@ gulp.task( ) ); -gulp.task('updateBuildNumber', async () => { - await updateBuildNumber(); -}); - -/** - * For multi-platform builds We end up generating multiple VSIX in the same pipeline. - * As a result this runs multiple times in the same pipeline, - * and we can have different build numbers for different VSIX. - * - * On CI, we use the Azure Build Number to generate a unique build number. - * The Azure Build Number will contain the date time information of the current build time - */ -function getBuildDate() { - const vscBuildId = process.env.VSC_BUILD_ID || ''; - const buildParts = vscBuildId.split('_'); - if (buildParts.length >= 3) { - return new Date( - parseInt(buildParts[0].substring(0, 4), 10), - parseInt(buildParts[0].substring(4, 6), 10) - 1, - parseInt(buildParts[0].substring(6), 10), - parseInt(buildParts[1], 10), - parseInt(buildParts[2], 10) - ); - } else { - return new Date(); - } -} - -async function updateBuildNumber() { - // Edit the version number from the package.json - const packageJsonContents = await fs.readFile('package.json', 'utf-8'); - const packageJson = JSON.parse(packageJsonContents); - - // Change version number - // 3rd part of version is limited to Max Int32 numbers (in VSC Marketplace). - // Hence build numbers can only be YYYY.MMM.2147483647 - // NOTE: For each of the following strip the first 3 characters from the build number. - // E.g. if we have build number of `build number = 3264527301, then take 4527301 - - // To ensure we can have point releases & insider builds, we're going with the following format: - // Insider & Release builds will be YYYY.MMM.100 - // When we have a hot fix, we update the version to YYYY.MMM.110 - // If we have more hot fixes, they'll be YYYY.MMM.120, YYYY.MMM.130, & so on. - - const versionParts = packageJson.version.split('.'); - // New build is of the form `DDDHHMM` (day of year, hours, minute) (7 digits, as out of the 10 digits first three are reserved for `100` or `101` for patches). - // Use date time for build, this way all subsequent builds are incremental and greater than the others before. - // Example build for 3Jan 12:45 will be `0031245`, and 16 Feb 8:50 will be `0470845` - const today = getBuildDate(); - const dayCount = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; - const dayOfYear = dayCount[today.getMonth()] + today.getDate() + 1; - const buildNumberSuffix = `${dayOfYear.toString().padStart(3, '0')}${(today.getHours() + 1) - .toString() - .padStart(2, '0')}${today.getMinutes().toString().padStart(2, '0')}`; - const buildNumber = `${versionParts[2].substring(0, 3)}${buildNumberSuffix}`; - const newVersion = - versionParts.length > 1 ? `${versionParts[0]}.${versionParts[1]}.${buildNumber}` : packageJson.version; - packageJson.version = newVersion; - console.log('Build Number', newVersion); - // Write back to the package json - await fs.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); -} - async function buildWebPack(webpackConfigName, args, env) { // Remember to perform a case insensitive search. const allowedWarnings = getAllowedWarningsForWebPack(webpackConfigName).map((item) => item.toLowerCase()); diff --git a/package-lock.json b/package-lock.json index 70dfe0c..ecef7fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jupyter-hub", - "version": "2025.4.0", + "version": "2025.8.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "jupyter-hub", - "version": "2025.4.0", + "version": "2025.8.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index e85f072..f7c472a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jupyter-hub", "displayName": "JupyterHub", - "version": "2025.4.0", + "version": "2025.8.0", "description": "Support for connecting to Jupyter Hub in VS Code along with the Jupyter Extension", "publisher": "ms-toolsai", "preview": true, @@ -83,7 +83,6 @@ "test:unittests": "mocha --config ./build/.mocha.unittests.js.json ./out/**/*.unit.test.js", "lint": "eslint -c .eslintrc.js --ext .ts --ext .tsx src", "prettier-fix": "prettier 'src/**/*.ts*' --write && prettier 'build/**/*.js' --write", - "updateBuildNumber": "node ./build/updateBuildNumber.js", "esbuild-base-node": "esbuild ./src/extension.node.ts --bundle --outfile=dist/extension.node.js --external:vscode --external:node:crypto --format=cjs --platform=node", "esbuild-base-web": "esbuild ./src/extension.web.ts --bundle --outfile=dist/extension.web.js --external:vscode --external:node:crypto --format=cjs --target=es2018 --define:global=this", "esbuild-test-web": "esbuild ./src/test/suite/index.web.ts --bundle --outfile=dist/test.index.web.js --external:vscode --external:node:crypto --format=cjs --target=es2018 --define:global=this --alias:stream=stream-browserify",