diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index 1e308bd..c2e5355 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -19,64 +19,91 @@ extends: sdl: sourceAnalysisPool: 1es-windows-2022-x64 tsa: - enabled: true + enabled: false # TSA is already covered by pipeline.yml stages: - stage: Build jobs: - - job: APIScan - pool: - name: 1es-windows-2022-x64 - os: Windows - steps: - - pwsh: | - echo @" + - job: APIScan + pool: + name: 1es-windows-2022-x64 + os: Windows + variables: + - group: "API Scan" + steps: + - pwsh: | + echo @" + - "@ > nuget.config - displayName: Change feed + "@ > nuget.config + displayName: Change feed - - task: NuGetAuthenticate@1 + - task: NuGetAuthenticate@1 - - pwsh: ./setup-packages.ps1 - displayName: Download and extract C# packages + - pwsh: | + $includes = @' + { + 'target_defaults': { + 'conditions': [ + ['OS=="win"', { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalOptions': [ + '/profile' + ] + } + } + }] + ] + } + } + '@ - - script: npm ci - displayName: Install and build + if (!(Test-Path "~/.gyp")) { + mkdir "~/.gyp" + echo $includes > "~/.gyp/include.gypi" + } + displayName: Create include.gypi - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)/build' - Contents: | - '**\*.dll' - '**\*.node' - '**\*.pdb' - TargetFolder: '$(Agent.TempDirectory)/apiscan' - flattenFolders: true - displayName: Copy files for APIScan - condition: succeeded() + - script: npm ci + displayName: Build - # Run APIScan - # - task: APIScan@2 - # inputs: - # softwareFolder: '$(Agent.TempDirectory)/apiscan' - # softwareName: 'vscode-node-speech' - # softwareVersionNum: '1' - # isLargeApp: false - # toolVersion: 'Latest' - # displayName: Run APIScan - # condition: succeeded() - # env: - # AzureServicesAuthConnectionString: $(apiscan-connectionstring) + - task: CopyFiles@2 + inputs: + Contents: | + build/**/*.dll + build/**/*.node + build/**/*.pdb + .cache/SpeechSDK/**/*.pdb + TargetFolder: "$(Agent.TempDirectory)/apiscan" + flattenFolders: true + displayName: Copy files for APIScan + condition: succeeded() - - task: PublishSecurityAnalysisLogs@3 - displayName: Publish security logs - inputs: - ArtifactName: 'CodeAnalysisLogs' - ArtifactType: 'Container' - AllTools: true - ToolLogsNotFoundAction: 'Standard' + - task: APIScan@2 + inputs: + softwareFolder: "$(Agent.TempDirectory)/apiscan" + softwareName: "vscode-node-speech" + softwareVersionNum: "1" + symbolsFolder: "srv*https://symweb.azurefd.net;$(Agent.TempDirectory)/apiscan" + isLargeApp: false + toolVersion: "Latest" + azureSubscription: "vscode-apiscan" + displayName: Run APIScan + condition: succeeded() + env: + AzureServicesAuthConnectionString: $(apiscan-connectionstring) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + + - task: PublishSecurityAnalysisLogs@3 + displayName: Publish security logs + inputs: + ArtifactName: "CodeAnalysisLogs" + ArtifactType: "Container" + AllTools: true + ToolLogsNotFoundAction: "Standard" diff --git a/.vscode/settings.json b/.vscode/settings.json index f1e1553..1ae0482 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -85,4 +85,11 @@ "git.branchProtectionPrompt": "alwaysCommitToNewBranch", "git.branchRandomName.enable": true, "git.pullBeforeCheckout": true, + "[yaml]": { + "editor.insertSpaces": true, + "editor.tabSize": 2, + "editor.autoIndent": "advanced", + "diffEditor.ignoreTrimWhitespace": false, + "editor.formatOnSave": true + } } \ No newline at end of file diff --git a/setup-packages.ps1 b/setup-packages.ps1 index 257c259..42bd818 100644 --- a/setup-packages.ps1 +++ b/setup-packages.ps1 @@ -1,6 +1,8 @@ $SDK_VERSION = "1.37.0" $TEMP_PACKAGE_DIR = "temp_packages" +mkdir $TEMP_PACKAGE_DIR + dotnet add package Microsoft.CognitiveServices.Speech --version $SDK_VERSION --package-directory $TEMP_PACKAGE_DIR dotnet add package Microsoft.CognitiveServices.Speech.Extension.Embedded.SR --version $SDK_VERSION --package-directory $TEMP_PACKAGE_DIR dotnet add package Microsoft.CognitiveServices.Speech.Extension.Embedded.TTS --version $SDK_VERSION --package-directory $TEMP_PACKAGE_DIR