diff --git a/.azure-pipelines/release-pipeline.yml b/.azure-pipelines/release-pipeline.yml new file mode 100644 index 000000000..73ec5b6b6 --- /dev/null +++ b/.azure-pipelines/release-pipeline.yml @@ -0,0 +1,88 @@ +# CI/Release pipeline - triggers on merge to master/releases, builds, tests, and publishes packages +# This pipeline will be extended to the OneESPT template +trigger: +- master +- features/* +- releases/* + +variables: +- group: npm-tokens +- name: nodeVersion + value: '16.13.0' +- name: nodeVersionForPowershell + value: '20.x' + +resources: + repositories: + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + featureFlags: + autoBaseline: false + sdl: + baseline: + baselineSet: default + baselineFile: $(Build.SourcesDirectory)/.gdn/.gdnbaselines + sourceAnalysisPool: + name: 1ES-ABTT-Shared-Pool + image: abtt-windows-2025 + os: windows + customBuildTags: + - ES365AIMigrationTooling + stages: + - stage: stage + jobs: + ################################################# + - job: windows + ################################################# + pool: + name: 1ES-ABTT-Shared-Pool + image: abtt-windows-2025 + os: windows + steps: + - template: /azure-pipelines-steps-node.yml@self + parameters: + os: Windows_NT + + ################################################# + - job: linux + ################################################# + pool: + name: 1ES-ABTT-Shared-Pool + image: abtt-ubuntu-2404 + os: linux + templateContext: + outputs: + - output: pipelineArtifact + targetPath: 'node/_build' + artifactType: 'pipeline' + artifactName: 'npm-package' + steps: + - template: /azure-pipelines-steps-node.yml@self + parameters: + os: Linux + + - bash: | + echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc + npm publish || true # Ignore publish failures, usually will happen because package already exists + displayName: (task-lib) npm publish + workingDirectory: node/_build + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master')) + env: + NPM_TOKEN: $(npm-automation.token) + + ################################################# + - job: macOS + ################################################# + pool: + name: Azure Pipelines + image: macOS-latest + os: macOS + steps: + - template: /azure-pipelines-steps-node.yml@self + parameters: + os: Darwin diff --git a/azure-pipelines-steps-node.yml b/azure-pipelines-steps-node.yml index 65df27240..ca859f07a 100644 --- a/azure-pipelines-steps-node.yml +++ b/azure-pipelines-steps-node.yml @@ -20,19 +20,8 @@ steps: workingDirectory: node displayName: (task-lib) npm test -# Only on Linux. For CI runs on master, automatically publish packages -- ${{ if eq(parameters.os, 'Linux') }}: - - bash: | - echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc - npm publish || true # Ignore publish failures, usually will happen because package already exists - displayName: (task-lib) npm publish - workingDirectory: node/_build - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master')) - env: - NPM_TOKEN: $(npm-automation.token) - - # PublishPipelineArtifact step is configured in the base template. - # See the templateContext section in the azure-pipelines.yml file +# Only on Linux. PublishPipelineArtifact step is configured in the base template. +# See the templateContext section in the azure-pipelines.yml file # Only on Windows. Build VstsTaskSdk for powershell - ${{ if eq(parameters.os, 'Windows_NT') }}: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d86724f13..71d5e23ed 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,13 +1,8 @@ -# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. -# This pipeline will be extended to the OneESPT template +# PR validation pipeline - build and test only, no publishing # The Task 'PublishPipelineArtifact@1' has been converted to an output named '' in the templateContext section. -trigger: -- master -- features/* -- releases/* +trigger: none variables: -- group: npm-tokens - name: nodeVersion value: '16.13.0' - name: nodeVersionForPowershell