diff --git a/tools/pipelines/templates/build-docker-service.yml b/tools/pipelines/templates/build-docker-service.yml index e3fc31a2e299..9be8346d1227 100644 --- a/tools/pipelines/templates/build-docker-service.yml +++ b/tools/pipelines/templates/build-docker-service.yml @@ -123,6 +123,14 @@ resources: type: git name: 1ESPipelineTemplates/M365GPT ref: refs/tags/release + # Listing a pipeline as a resource makes its artifacts available for download in any job + pipelines: + # Access to this pipelines artifacts allows 1ES deployment jobs to install build tools without checking out out a repo. + - pipeline: buildTools-resource + project: internal + source: Build - build-tools + branch: main + extends: # The pipeline extends the 1ES pipeline template which will inject different SDL and compliance tasks. # Read more: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/onboarding/overview diff --git a/tools/pipelines/templates/build-npm-client-package.yml b/tools/pipelines/templates/build-npm-client-package.yml index 57d1f7d2ed11..71460729e686 100644 --- a/tools/pipelines/templates/build-npm-client-package.yml +++ b/tools/pipelines/templates/build-npm-client-package.yml @@ -147,6 +147,13 @@ resources: type: git name: 1ESPipelineTemplates/M365GPT ref: refs/tags/release + # Listing a pipeline as a resource makes its artifacts available for download in any job + pipelines: + # Access to this pipelines artifacts allows 1ES deployment jobs to install build tools without checking out out a repo. + - pipeline: buildTools-resource + project: internal + source: Build - build-tools + branch: main extends: # The pipeline extends the 1ES pipeline template which will inject different SDL and compliance tasks. diff --git a/tools/pipelines/templates/build-npm-package.yml b/tools/pipelines/templates/build-npm-package.yml index c308fe9dfc14..05cf54dbcb51 100644 --- a/tools/pipelines/templates/build-npm-package.yml +++ b/tools/pipelines/templates/build-npm-package.yml @@ -146,6 +146,13 @@ resources: type: git name: 1ESPipelineTemplates/M365GPT ref: refs/tags/release + # Listing a pipeline as a resource makes its artifacts available for download in any job + pipelines: + # Access to this pipelines artifacts allows 1ES deployment jobs to install build tools without checking out out a repo. + - pipeline: buildTools-resource + project: internal + source: Build - build-tools + branch: main extends: # The pipeline extends the 1ES pipeline template which will inject different SDL and compliance tasks. diff --git a/tools/pipelines/templates/include-publish-npm-package-deployment.yml b/tools/pipelines/templates/include-publish-npm-package-deployment.yml index 7b276394ef02..65b497045739 100644 --- a/tools/pipelines/templates/include-publish-npm-package-deployment.yml +++ b/tools/pipelines/templates/include-publish-npm-package-deployment.yml @@ -51,21 +51,41 @@ jobs: variables: version: $[ stageDependencies.build.build.outputs['SetVersion.version']] isLatest: $[ stageDependencies.build.build.outputs['SetVersion.isLatest']] + templateContext: + type: releaseJob + # in() returns true if the first parameter is equal to any of the others + isProduction: ${{ in(variables['release'], 'release', 'prerelease') }} + + # This 'inputs' section downloads initial required artifacts/data for this job. + inputs: + - input: pipelineArtifact + pipeline: buildTools-resource + artifactName: pack + targetPath: $(Pipeline.Workspace)/buildTools-zip + + - input: pipelineArtifact + artifactName: pack + buildType: current + targetPath: $(Pipeline.Workspace)/pack strategy: runOnce: deploy: steps: - - checkout: self - clean: true - persistCredentials: true # Necessary for creation of git tags to work - - download: current - artifact: pack - template: /tools/pipelines/templates/include-use-node-version.yml@self - - template: /tools/pipelines/templates/include-install-build-tools.yml@self - parameters: - buildDirectory: ${{ parameters.buildDirectory }} - buildToolsVersionToInstall: ${{ parameters.buildToolsVersionToInstall }} - pnpmStorePath: ${{ parameters.pnpmStorePath }} + + - task: Bash@3 + name: InstallBuildToolsFromTarball + displayName: Install Fluid Build Tools from artifact tarball + inputs: + targetType: 'inline' + workingDirectory: '$(Pipeline.Workspace)/buildTools-zip/tarballs' + script: | + set -eu -o pipefail + echo "Listing files in directory: $(pwd)" + ls -la + echo "Attempting install of build tools from build tools pipeline artifact tarball" + npm i -g ./*.tgz + - template: /tools/pipelines/templates/include-publish-npm-package-steps.yml@self parameters: artifactPath: tarballs