From 7b9e1e7b763861355570432bdf3cbe19c68dcc82 Mon Sep 17 00:00:00 2001 From: Shiran Pasternak Date: Thu, 8 Jan 2026 11:01:57 -0500 Subject: [PATCH 1/3] Removes unused pipeline files --- .vsts/common/publish-packages.sh | 33 ----- .vsts/darwin/distribution.yml | 74 ----------- .vsts/darwin/notarize.yml | 21 ---- .vsts/darwin/sign.yml | 27 ---- .vsts/distribution.yml | 57 --------- .vsts/linux/distribution.yml | 50 -------- .vsts/win/distribution.yml | 56 --------- .vsts/win/sign.yml | 60 --------- desktop/scripts/azpipelines/update-latest.ts | 118 ------------------ .../scripts/azpipelines/upload-to-storage.ts | 94 -------------- desktop/scripts/azpipelines/utils.ts | 115 ----------------- 11 files changed, 705 deletions(-) delete mode 100755 .vsts/common/publish-packages.sh delete mode 100644 .vsts/darwin/distribution.yml delete mode 100644 .vsts/darwin/notarize.yml delete mode 100644 .vsts/darwin/sign.yml delete mode 100644 .vsts/distribution.yml delete mode 100644 .vsts/linux/distribution.yml delete mode 100644 .vsts/win/distribution.yml delete mode 100644 .vsts/win/sign.yml delete mode 100644 desktop/scripts/azpipelines/update-latest.ts delete mode 100644 desktop/scripts/azpipelines/upload-to-storage.ts delete mode 100644 desktop/scripts/azpipelines/utils.ts diff --git a/.vsts/common/publish-packages.sh b/.vsts/common/publish-packages.sh deleted file mode 100755 index 00c9b35fe1..0000000000 --- a/.vsts/common/publish-packages.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -set -e - -branch=$1 -if [ -z $1 ]; then - echo "Failed to publish package: No branch name supplied" - exit 1 -fi - -package_name=$2 -if [ -z $package_name ]; then - echo "Failed to publish package: No package name supplied" - exit 1 -fi - -ver=$(npm pkg get version | sed 's/"//g') -package_version=$(echo "$ver-$DIST_TAG.$BUILD_BUILDNUMBER" | sed 's/_//g') - -echo "Publishing package $package_name@$package_version" -echo "==================================" -echo "Working dir: $PWD" -echo "Branch: $branch" -echo "==================================" - -# Publish only from the main branch for now so that we don't have to worry -# about version bumping after releases from different branches. -if [ "$branch" = "refs/heads/main" ]; then - npm version --no-git-tag-version $package_version - npm publish --tag $DIST_TAG -else - echo "Skipped publishing $package_name@$package_version: Packages are only published from the main branch." -fi diff --git a/.vsts/darwin/distribution.yml b/.vsts/darwin/distribution.yml deleted file mode 100644 index 088c149d4b..0000000000 --- a/.vsts/darwin/distribution.yml +++ /dev/null @@ -1,74 +0,0 @@ -steps: - - template: ../common/set-dist-vars.yml - - template: ./darwin-dependencies.yml - - template: ../common/download-i18n-artifacts.yml - - - script: | - pwsh -File "$(System.DefaultWorkingDirectory)/Localize/copy-translations.ps1" -artifactsPath "$(Agent.BuildDirectory)/drop/loc" - displayName: 'Run copy-translations.ps1 with artifacts path (macOS)' - - - script: | - set -e - npm run build:prod - displayName: Build packages - - - script: | - set -e - dir=$(Agent.TempDirectory) - keychain=$dir/buildagent.keychain - security create-keychain -p pwd $keychain - security default-keychain -s $keychain - security unlock-keychain -p pwd $keychain - echo "$(apple-developer-certificate)" | base64 -D > $dir/cert.p12 - - # Check if certificate is valid - if openssl pkcs12 -in $dir/cert.p12 -nokeys -passin pass:"$(apple-developer-certificate-key)" | \ - openssl x509 -noout -dates -checkend 0; then - echo "Certificate is valid." - else - echo "##[error] Certificate is expired or invalid." - exit 1 - fi - - security import $dir/cert.p12 -k $keychain -P "$(apple-developer-certificate-key)" -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k pwd $keychain - - echo "##vso[task.setvariable variable=CSC_LINK]$dir/cert.p12 - echo "##vso[task.setvariable variable=CSC_KEY_PASSWORD]$(apple-developer-certificate-key) - displayName: Prepare Apple Developer certificate - - - script: | - set -e - npm run package darwin-app - cd ./release/mac - zip -y -r ../BatchExplorer-mac.zip ./BatchExplorer.app - cd ../.. - rm -rf ./release/mac/*.app - mkdir ./release/keep - cp ./release/*.zip ./release/keep/before-code-sign.zip - workingDirectory: desktop - displayName: Build .app - - - script: | - set -e - unzip ./release/BatchExplorer*.zip -d ./release/mac - ls ./release/mac - rm -f ./release/mac/*.pkg - npm run package darwin-dmg - rm -rf ./release/mac/* - workingDirectory: desktop - displayName: Build dmg - - - template: ./sign.yml - - - template: ./notarize.yml - - - script: npm run package darwin-manifest - workingDirectory: desktop - displayName: Create manifest - - - template: ../common/generate-sbom.yml - - - template: ../common/publish-artifacts.yml - parameters: - folder: darwin diff --git a/.vsts/darwin/notarize.yml b/.vsts/darwin/notarize.yml deleted file mode 100644 index 861e2b77ac..0000000000 --- a/.vsts/darwin/notarize.yml +++ /dev/null @@ -1,21 +0,0 @@ -steps: - - task: EsrpCodeSigning@2 - inputs: - ConnectedServiceName: 'ESRP CodeSign' - FolderPath: ./desktop/release - Pattern: 'BatchExplorer-mac.zip,*.dmg' - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode" : "CP-401337-Apple", - "OperationCode" : "MacAppNotarize", - "Parameters" : { - "BundleId": "com.microsoft.azure.BatchExplorer" - }, - "ToolName" : "sign", - "ToolVersion" : "1.0" - } - ] - SessionTimeout: 120 - displayName: Notarization diff --git a/.vsts/darwin/sign.yml b/.vsts/darwin/sign.yml deleted file mode 100644 index 146ea4bfd0..0000000000 --- a/.vsts/darwin/sign.yml +++ /dev/null @@ -1,27 +0,0 @@ -steps: - - task: UseDotNet@2 - displayName: 'Use .NET 6' - inputs: - packageType: sdk - version: 6.x - - - task: EsrpCodeSigning@2 - inputs: - ConnectedServiceName: 'ESRP CodeSign' - FolderPath: ./desktop/release - Pattern: 'BatchExplorer-mac.zip,*.dmg' - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-401337-Apple", - "OperationCode": "MacAppDeveloperSign", - "ToolName": "sign", - "ToolVersion": "1.0", - "Parameters": { - "Hardening": "--options=runtime" - } - } - ] - SessionTimeout: 120 - displayName: Codesign diff --git a/.vsts/distribution.yml b/.vsts/distribution.yml deleted file mode 100644 index d4cadb9154..0000000000 --- a/.vsts/distribution.yml +++ /dev/null @@ -1,57 +0,0 @@ -stages: - - stage: Localization - jobs: - - job: - pool: - name: Azure-Pipelines-EO-Batch-Explorer - demands: - - ImageOverride -equals BatchExplorerBuildImage-Windows - steps: - - task: OneLocBuild@2 - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - inputs: - locProj: 'Localize/LocProject.json' - outDir: '$(Build.ArtifactStagingDirectory)' - dependencyPackageSource: 'https://azurebatch.pkgs.visualstudio.com/_packaging/BatchExplorer/nuget/v3/index.json' - packageSourceAuth: 'patAuth' - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'drop' - publishLocation: 'Container' - - - stage: Build - dependsOn: Localization - condition: succeeded('Localization') - jobs: - - - job: Linux - timeoutInMinutes: 120 # Needed for Codesign + CodeQL - pool: - name: Azure-Pipelines-EO-Batch-Explorer - demands: - - ImageOverride -equals BatchExplorerBuildImage-Linux - steps: - - template: ./linux/distribution.yml - - - job: MacOS - timeoutInMinutes: 120 # Needed for Codesign + Notarization + CodeQL - pool: - vmImage: macOS-latest - demands: xcode - variables: - - group: BatchExplorer-Signing - - name: EOCompliance-Mac - value: true - steps: - - template: ./darwin/distribution.yml - - - job: Windows - timeoutInMinutes: 120 # Needed for Codesign + CodeQL - pool: - name: Azure-Pipelines-EO-Batch-Explorer - demands: - - ImageOverride -equals BatchExplorerBuildImage-Windows - steps: - - template: ./win/distribution.yml diff --git a/.vsts/linux/distribution.yml b/.vsts/linux/distribution.yml deleted file mode 100644 index b2c67b5a07..0000000000 --- a/.vsts/linux/distribution.yml +++ /dev/null @@ -1,50 +0,0 @@ -steps: - - template: ../common/set-dist-vars.yml - - template: ./linux-dependencies.yml - - template: ../common/download-i18n-artifacts.yml - - - script: | - pwsh -File "$(System.DefaultWorkingDirectory)/Localize/copy-translations.ps1" -artifactsPath "$(Agent.BuildDirectory)/drop/loc" - displayName: 'Run copy-translations.ps1 with artifacts path (Linux)' - - - script: | - set -e - npm run build:package - displayName: Build and pack - - - template: ./publish-npm-package.yml - parameters: - packagePath: ./packages/bonito-core - packageName: "@azure/bonito-core" - - - template: ./publish-npm-package.yml - parameters: - packagePath: ./packages/bonito-ui - packageName: "@azure/bonito-ui" - - - template: ./publish-npm-package.yml - parameters: - packagePath: ./packages/service - packageName: "@batch/ui-service" - - - template: ./publish-npm-package.yml - parameters: - packagePath: ./packages/react - packageName: "@batch/ui-react" - - - template: ./publish-npm-package.yml - parameters: - packagePath: ./packages/playground - packageName: "@batch/ui-playground" - - - script: | - set -e - npm run package linux-manifest - workingDirectory: desktop - displayName: Create manifest - - - template: ../common/generate-sbom.yml - - - template: ../common/publish-artifacts.yml - parameters: - folder: linux diff --git a/.vsts/win/distribution.yml b/.vsts/win/distribution.yml deleted file mode 100644 index 07bbec8605..0000000000 --- a/.vsts/win/distribution.yml +++ /dev/null @@ -1,56 +0,0 @@ -steps: - - template: ../common/set-dist-vars.yml - - template: ./credscan.yml - - template: ./win-dependencies.yml - - template: ../common/download-i18n-artifacts.yml - - - pwsh: | - $(System.DefaultWorkingDirectory)/Localize/copy-translations.ps1 -artifactsPath "$(Agent.BuildDirectory)/drop/loc" - displayName: 'Run copy-translations.ps1 with artifacts path (Windows)' - - - pwsh: | - $version = npm run -s ts scripts/package/get-version - Write-Host "Updating build number to $version" - Write-Host "##vso[build.updatebuildnumber]$version" - workingDirectory: desktop - displayName: Update build version for packaging - - - pwsh: | - . .vsts/win/exec.ps1 - $ErrorActionPreference = "Stop" - exec { npm run build:prod } - displayName: Build all packages - - - pwsh: | - . ../.vsts/win/exec.ps1 - $ErrorActionPreference = "Stop" - exec { npm run package win-exe } - workingDirectory: desktop - displayName: Build .exe - - - template: ./security-analysis.yml - - - template: ./sign.yml - parameters: - name: "Sign executable and dll" - pattern: | - **/*.exe - **/*.dll - - - pwsh: npm run package win-installer - workingDirectory: desktop - displayName: Build installer - - - template: ./sign.yml - parameters: - name: "Sign installer" - pattern: | - **/BatchExplorer*Setup*.exe - - - pwsh: npm run package win-manifest - workingDirectory: desktop - displayName: Create manifest - - template: ../common/generate-sbom.yml - - template: ../common/publish-artifacts.yml - parameters: - folder: windows diff --git a/.vsts/win/sign.yml b/.vsts/win/sign.yml deleted file mode 100644 index bc1dba1b10..0000000000 --- a/.vsts/win/sign.yml +++ /dev/null @@ -1,60 +0,0 @@ -parameters: - # Display name for the step - name: 'Code sign' - # Pattern to include - pattern: '' - -steps: - - task: UseDotNet@2 - displayName: 'Use .NET Core sdk' - inputs: - packageType: sdk - version: 2.1.x - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - displayName: ${{ parameters.name }} - inputs: - ConnectedServiceName: 'ESRP CodeSign' - FolderPath: ./desktop/release - Pattern: ${{ parameters.pattern }} - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName":"FileDigest", - "parameterValue":"/fd \"SHA256\"" - }, - { - "parameterName": "OpusName", - "parameterValue": "Microsoft" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "http://www.microsoft.com" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName":"TimeStamp", - "parameterValue":"/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "sign", - "toolVersion": "1.0" - }, - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolVerify", - "parameters": [ ], - "toolName": "sign", - "toolVersion": "1.0" - } - ] - SessionTimeout: 120 diff --git a/desktop/scripts/azpipelines/update-latest.ts b/desktop/scripts/azpipelines/update-latest.ts deleted file mode 100644 index 9aca4c4a0c..0000000000 --- a/desktop/scripts/azpipelines/update-latest.ts +++ /dev/null @@ -1,118 +0,0 @@ -// eslint-disable no-console -import makeDir from "make-dir"; -import * as path from "path"; -import * as fs from "fs"; -import { getManifest, getContainerName, BlobStorageClient } from "./utils"; -import { promisify } from "util"; - -const copyFile = promisify(fs.copyFile); - -if (!process.env.AGENT_TEMPDIRECTORY) { - throw new Error( - "Required AGENT_TEMPDIRECTORY environment variable is empty" - ); -} -const stagingDir = path.join(process.env.AGENT_TEMPDIRECTORY, - "batchexplorer-github"); -console.log("Env", process.env); -const storageAccountName = process.env.AZURE_STORAGE_ACCOUNT; -const storageAccountKey = process.argv[2]; - -console.log("Artifact staging directory is", stagingDir); -console.log(`##vso[task.setvariable variable=BE_GITHUB_ARTIFACTS_DIR]${stagingDir}`); - -if (!storageAccountName) { - console.error(`No storage account name found in AZURE_STORAGE_ACCOUNT`); - process.exit(-1); -} - -if (!storageAccountKey) { - console.error("No storage account key passed"); - process.exit(-1); -} - -console.log("Uploading to storage account:", storageAccountName); - -const storageClient = new BlobStorageClient(storageAccountName, - storageAccountKey); - -async function copyBlob(source, container, blob) { - const poller = await storageClient.beginCopyBlob(source, container, blob); - try { - return await poller.pollUntilDone(); - } catch (error) { - switch (error.name) { - case "PollerCancelledError": - throw new Error(`Copy was cancelled: ${error.message}`); - case "PollerStoppedError": - throw new Error(`Copy was stopped: ${error.message}`); - default: - throw new Error(`Copy failed: ${error.message}`); - } - } -} - -function getLatestFile(os) { - switch (os) { - case "darwin": - return "latest-mac.yml"; - case "linux": - return "latest-linux.yml"; - default: - return "latest.yml"; - } -} - -async function copyFilesToArtifactStaging(os) { - const manifest = getManifest(os); - if (manifest.files) { - console.log(`Copy ${manifest.files.length} files for os: ${os}`); - for (const file of manifest.files) { - if (file.path) { - await copyFile( - path.join(os, file.path), - path.join(stagingDir, file.path) - ); - } - } - } -} - -async function copyAllFilesToArtifactStaging() { - console.log(`Starting copying artifacts for github release`); - await makeDir(stagingDir); - await copyFilesToArtifactStaging("windows"); - await copyFilesToArtifactStaging("linux"); - await copyFilesToArtifactStaging("darwin"); -} - -async function updateLatest(os) { - const manifest = getManifest(os); - console.log(`##vso[task.setvariable variable=BE_RELEASE_VERSION]${manifest.version}`); - console.log(`Updating latest for os: ${os}`); - if (!manifest.buildType) { - throw new Error( - "Manifest does not contain required value for buildType" - ); - } - const container = getContainerName(manifest.buildType); - const latestFile = getLatestFile(os); - const originalBlob = `${manifest.version}/${latestFile}`; - const sourceUrl = storageClient.getUrl(container, originalBlob); - console.log("Copying", sourceUrl, container, latestFile); - return copyBlob(sourceUrl, container, latestFile); -} - -async function run() { - await copyAllFilesToArtifactStaging(); - await updateLatest("windows"); - await updateLatest("linux"); - await updateLatest("darwin"); -} - -run().then(() => { - console.log("Done uploading..."); -}).catch(e => { - console.error(`Error in`, e); - process.exit(1); -}); diff --git a/desktop/scripts/azpipelines/upload-to-storage.ts b/desktop/scripts/azpipelines/upload-to-storage.ts deleted file mode 100644 index 6f0ab5a3d3..0000000000 --- a/desktop/scripts/azpipelines/upload-to-storage.ts +++ /dev/null @@ -1,94 +0,0 @@ -// eslint-disable no-console -import * as fs from "fs"; -import * as path from "path"; -import { getManifest, getContainerName, BlobStorageClient } from "./utils"; -import * as crypto from "crypto"; - -const storageAccountName = process.env.AZURE_STORAGE_ACCOUNT; -const storageAccountKey = process.argv[2]; -const attemptNumber = Number(process.env.Release_AttemptNumber); - -console.log(`This is the ${attemptNumber} try to release`); - -if (!storageAccountName) { - console.error(`No storage account name found in AZURE_STORAGE_ACCOUNT`); - process.exit(-1); -} - -if (!storageAccountKey) { - console.error("No storage account key passed"); - process.exit(-1); -} - -console.log("Uploading to storage account:", storageAccountName); - -function computeFileMd5(filename) { - const data = fs.readFileSync(filename); - return crypto.createHash("md5").update(data).digest("base64"); -} - -const storageClient = new BlobStorageClient(storageAccountName, - storageAccountKey); - -async function createBlobFromLocalFile(container, filename, blobName, override = false) { - const response = await storageClient.createBlob(container, blobName, - filename, override); - - console.log("Uploaded", response); - return response; -} - -async function uploadToBlob(container, filename, blobName, override = false) { - console.log(`Uploading ${filename} ====> Container=${container}, Blobname=${blobName}`); - try { - return await createBlobFromLocalFile(container, filename, blobName, override); - } catch (error) { - if (error.details.errorCode === "BlobAlreadyExists") { - const blob = await storageClient.getBlob(container, blobName); - const md5 = computeFileMd5(filename); - const blobMd5 = blob.blobContentMD5?.toString(); - if (md5 === blobMd5) { - console.log(`Already uploaded ${filename} skipping(Md5 hash matched)`); - } else { - throw new Error(`Error blob already exists but doesn't match the local file. ${md5} != ${blobMd5}`); - } - } else { - throw error; - } - } -} - -async function uploadFiles(os) { - const manifest = getManifest(os); - if (manifest.files) { - console.log(`Uploading ${manifest.files?.length} files for os: ${os}`); - if (!manifest.buildType) { - throw new Error( - "Manifest does not contain required value for buildType" - ); - } - const container = getContainerName(manifest.buildType); - for (const file of manifest.files) { - if (file.path) { - await uploadToBlob(container, path.join(os, file.path), - file.remotePath); - } - } - } else { - console.error(`Cannot get manifest for ${os}`); - } -} - -async function run() { - console.log(`Starting uploading artifacts`); - await uploadFiles("windows"); - await uploadFiles("linux"); - await uploadFiles("darwin"); -} - -run().then(() => { - console.log("Done uploading..."); -}).catch(e => { - console.error(`Error in node`, e); - process.exit(1); -}); diff --git a/desktop/scripts/azpipelines/utils.ts b/desktop/scripts/azpipelines/utils.ts deleted file mode 100644 index f20827c349..0000000000 --- a/desktop/scripts/azpipelines/utils.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { - BlobBeginCopyFromURLResponse, - BlobDownloadResponseParsed, - BlobGetPropertiesResponse, - BlobUploadCommonResponse, - BlockBlobClient, - PollerLike, - PollOperationState, - StorageSharedKeyCredential -} from "@azure/storage-blob"; -import * as fs from "fs"; -import * as path from "path"; - -interface Manifest { - version?: string; - buildType?: string; - files?: [ - { - path?: string; - remotePath?: string; - } - ]; -} - -export function getManifest(os: string): Manifest { - const filePath = path.join(os, "manifest.json"); - if (!fs.existsSync(filePath)) { - throw new Error(`Manifest path ${filePath} does not exist`); - } - return JSON.parse(fs.readFileSync(filePath).toString()) || {}; -} - -export function getContainerName(buildType: string): string { - switch (buildType) { - case "stable": - return "stable"; - case "insider": - return "insider"; - default: - return "test"; - } -} - - -export function storageURL( - account: string, - container?: string, - blob?: string -): string { - let url = `https://${account}.blob.core.windows.net`; - if (container) { - url = `${url}/${container}`; - if (blob) { - url = `${url}/${blob}`; - } - } - return url; -} - -export type CopyPoller = PollerLike< - PollOperationState, - BlobBeginCopyFromURLResponse ->; -export class BlobStorageClient { - private credential: StorageSharedKeyCredential; - constructor(private accountName: string, accountKey: string) { - this.credential = new StorageSharedKeyCredential(accountName, - accountKey); - } - - private getBlobClient(container: string, blob: string) { - return new BlockBlobClient( - storageURL(this.accountName, container, blob), - this.credential - ); - } - - public getUrl(container: string, blob: string): string { - return storageURL(this.accountName, container, blob); - } - - public async createBlob( - container: string, - blob: string, - filename: string, - override = true - ): - Promise { - const blobClient = this.getBlobClient(container, blob); - const conditions = override ? {} : { ifNoneMatch: "*" }; - const response = await blobClient.uploadFile(filename, { conditions }); - return response; - } - - public async getBlob(container: string, blob: string): - Promise { - return this.getBlobClient(container, blob).download(0); - } - - public async getBlobProperties(container: string, blob: string): - Promise { - return this.getBlobClient(container, blob).getProperties(); - } - - public async beginCopyBlob(source: string, container: string, blob: string): - Promise { - const client = this.getBlobClient(container, blob); - return client.beginCopyFromURL(source, { - intervalInMs: 5000, - onProgress(state) { - console.log(`Copy "${blob}" is pending ${state.copyProgress}`); - }, - }); - } -} From cefa9aa2236eef5e9ff164fe21502f1eb1fceb37 Mon Sep 17 00:00:00 2001 From: Shiran Pasternak Date: Mon, 12 Jan 2026 14:53:09 -0500 Subject: [PATCH 2/3] Removes other unused dist pipeline files --- .vsts/common/build-vars.ps1 | 39 ------------------------ .vsts/common/download-i18n-artifacts.yml | 8 ----- .vsts/common/generate-sbom.yml | 6 ---- .vsts/common/set-dist-vars.yml | 3 -- .vsts/linux/publish-npm-package.yml | 10 ------ 5 files changed, 66 deletions(-) delete mode 100644 .vsts/common/build-vars.ps1 delete mode 100644 .vsts/common/download-i18n-artifacts.yml delete mode 100644 .vsts/common/generate-sbom.yml delete mode 100644 .vsts/common/set-dist-vars.yml delete mode 100644 .vsts/linux/publish-npm-package.yml diff --git a/.vsts/common/build-vars.ps1 b/.vsts/common/build-vars.ps1 deleted file mode 100644 index 271e3650f3..0000000000 --- a/.vsts/common/build-vars.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -# Sets build variables for use in various build stages - -param ( - $branch, - $buildNumber -) -# This compute the build type for VSTS build -$buildType = "dev" -$distTag = "latest" - -Write-Host "Branch is $branch" - -If ($branch -like "refs/heads/main") { - $buildType = "insider" - $distTag = "insider" -} - -If ($branch -like "refs/heads/stable") { - $buildType = "stable" - $distTag = "stable" -} - -# Change to curent branch for testing -If ($branch -like "refs/heads/feature/signing-vsts") { - $buildType = "testing" -} - -Write-Host "Build type is $buildType" -Write-Host "##vso[build.addbuildtag]$buildType" -Write-Host "##vso[task.setvariable variable=BUILD_TYPE]$buildType" - -Write-Host "Setting publication distribution tag to $distTag" -Write-Host "##vso[task.setvariable variable=DIST_TAG]$distTag" - -# Hyphens in the version causes RPM packaging to fail -# See https://azurebatch.visualstudio.com/BatchExplorer/_workitems/edit/379 -$newBuildNumber = $buildNumber -replace '-', '_' -Write-Host "Setting build number to $newBuildNumber" -Write-Host "##vso[build.updatebuildnumber]$newBuildNumber" diff --git a/.vsts/common/download-i18n-artifacts.yml b/.vsts/common/download-i18n-artifacts.yml deleted file mode 100644 index 633adf962d..0000000000 --- a/.vsts/common/download-i18n-artifacts.yml +++ /dev/null @@ -1,8 +0,0 @@ -steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Localization Build Artifacts' - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'drop' - downloadPath: '$(Agent.BuildDirectory)' diff --git a/.vsts/common/generate-sbom.yml b/.vsts/common/generate-sbom.yml deleted file mode 100644 index 766a940234..0000000000 --- a/.vsts/common/generate-sbom.yml +++ /dev/null @@ -1,6 +0,0 @@ -steps: - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: "SBOM Generation" - inputs: - BuildDropPath: ./desktop/release - diff --git a/.vsts/common/set-dist-vars.yml b/.vsts/common/set-dist-vars.yml deleted file mode 100644 index a1f215f63e..0000000000 --- a/.vsts/common/set-dist-vars.yml +++ /dev/null @@ -1,3 +0,0 @@ -steps: - - pwsh: $(Build.SourcesDirectory)/.vsts/common/build-vars.ps1 "$(Build.SourceBranch)" "$(Build.BuildNumber)" - displayName: Resolve build info diff --git a/.vsts/linux/publish-npm-package.yml b/.vsts/linux/publish-npm-package.yml deleted file mode 100644 index 00db55bf3a..0000000000 --- a/.vsts/linux/publish-npm-package.yml +++ /dev/null @@ -1,10 +0,0 @@ -parameters: - packagePath: '' - packageName: '' - -steps: - - script: | - set -e - $(Build.SourcesDirectory)/.vsts/common/publish-packages.sh $(Build.SourceBranch) ${{parameters.packageName}} - displayName: "Publish package: ${{parameters.packageName}}" - workingDirectory: ${{parameters.packagePath}} From e2fde137735422afe17d2aebd0f97075cbe0e7a9 Mon Sep 17 00:00:00 2001 From: Shiran Pasternak Date: Mon, 12 Jan 2026 14:58:22 -0500 Subject: [PATCH 3/3] Simplifies CI pipeline code --- .../dependencies.yml} | 4 ++-- .vsts/{ => common}/pipelines.npmrc | 0 .vsts/darwin/darwin-dependencies.yml | 2 +- .vsts/dependencies.yml | 2 -- .vsts/linux/linux-dependencies.yml | 2 +- .vsts/{ => win}/cred-scan-exclude.json | 0 .vsts/win/credscan.yml | 2 +- .vsts/win/exec.ps1 | 23 ------------------- .vsts/win/win-dependencies.yml | 13 ++++++----- 9 files changed, 12 insertions(+), 36 deletions(-) rename .vsts/{node-setup.yml => common/dependencies.yml} (84%) rename .vsts/{ => common}/pipelines.npmrc (100%) delete mode 100644 .vsts/dependencies.yml rename .vsts/{ => win}/cred-scan-exclude.json (100%) delete mode 100644 .vsts/win/exec.ps1 diff --git a/.vsts/node-setup.yml b/.vsts/common/dependencies.yml similarity index 84% rename from .vsts/node-setup.yml rename to .vsts/common/dependencies.yml index 66491a886e..ff4d6f0ef8 100644 --- a/.vsts/node-setup.yml +++ b/.vsts/common/dependencies.yml @@ -4,7 +4,7 @@ steps: versionSpec: '18.x.x' displayName: Set NodeJS version - - script: cp .vsts/pipelines.npmrc $(Agent.TempDirectory)/.npmrc + - script: cp .vsts/common/pipelines.npmrc $(Agent.TempDirectory)/.npmrc displayName: Stage .npmrc file - task: npmAuthenticate@0 @@ -13,7 +13,7 @@ steps: workingFile: $(Agent.TempDirectory)/.npmrc # Using the 'script' task as-written below doesn't work properly on Windows. - # It seem to be adding an extra quote character somehow. Using a separate + # It seems to be adding an extra quote character somehow. Using a separate # powershell task for Windows gets around this issue. - script: | echo "##vso[task.setvariable variable=npm_config_userconfig]$(Agent.TempDirectory)/.npmrc" diff --git a/.vsts/pipelines.npmrc b/.vsts/common/pipelines.npmrc similarity index 100% rename from .vsts/pipelines.npmrc rename to .vsts/common/pipelines.npmrc diff --git a/.vsts/darwin/darwin-dependencies.yml b/.vsts/darwin/darwin-dependencies.yml index cbd73fc158..f89becdb50 100644 --- a/.vsts/darwin/darwin-dependencies.yml +++ b/.vsts/darwin/darwin-dependencies.yml @@ -1,5 +1,5 @@ steps: - - template: ../dependencies.yml + - template: ../common/dependencies.yml - script: | set -e echo "Node.js version $(node --version)" diff --git a/.vsts/dependencies.yml b/.vsts/dependencies.yml deleted file mode 100644 index afa0c52f1b..0000000000 --- a/.vsts/dependencies.yml +++ /dev/null @@ -1,2 +0,0 @@ -steps: - - template: ./node-setup.yml diff --git a/.vsts/linux/linux-dependencies.yml b/.vsts/linux/linux-dependencies.yml index 03a6818581..8c32328dd6 100644 --- a/.vsts/linux/linux-dependencies.yml +++ b/.vsts/linux/linux-dependencies.yml @@ -1,5 +1,5 @@ steps: - - template: ../dependencies.yml + - template: ../common/dependencies.yml - script: | set -e echo "Node.js version $(node --version)" diff --git a/.vsts/cred-scan-exclude.json b/.vsts/win/cred-scan-exclude.json similarity index 100% rename from .vsts/cred-scan-exclude.json rename to .vsts/win/cred-scan-exclude.json diff --git a/.vsts/win/credscan.yml b/.vsts/win/credscan.yml index 78fedeb8d9..840b775778 100644 --- a/.vsts/win/credscan.yml +++ b/.vsts/win/credscan.yml @@ -3,6 +3,6 @@ steps: - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3 displayName: "Run CredScan" inputs: - suppressionsFile: .vsts/cred-scan-exclude.json + suppressionsFile: .vsts/win/cred-scan-exclude.json debugMode: false diff --git a/.vsts/win/exec.ps1 b/.vsts/win/exec.ps1 deleted file mode 100644 index 9adca156e8..0000000000 --- a/.vsts/win/exec.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -# Taken from psake https://github.com/psake/psake - -<# -.SYNOPSIS - This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode - to see if an error occcured. If an error is detected then an exception is thrown. - This function allows you to run command-line programs without having to - explicitly check the $lastexitcode variable. -.EXAMPLE - exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed" -#> -function Exec -{ - [CmdletBinding()] - param( - [Parameter(Position=0,Mandatory=1)][scriptblock]$cmd, - [Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd) - ) - & $cmd - if ($lastexitcode -ne 0) { - throw ("Exec: " + $errorMessage) - } -} diff --git a/.vsts/win/win-dependencies.yml b/.vsts/win/win-dependencies.yml index ea5b80d636..45298a6644 100644 --- a/.vsts/win/win-dependencies.yml +++ b/.vsts/win/win-dependencies.yml @@ -1,10 +1,11 @@ steps: - - template: ../dependencies.yml + - template: ../common/dependencies.yml - pwsh: | - . .vsts/win/exec.ps1 $ErrorActionPreference = "Stop" - exec { Write-Host "Node.js version" $(node --version) } - exec { Write-Host "NPM version" $(npm --version) } - exec { npm ci } - exec { npm run dev-setup } + Write-Host "Node.js version $(node --version)" + Write-Host "NPM version $(npm --version)" + npm ci + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + npm run dev-setup + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } displayName: Install Windows dependencies