# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 parameters: release_tag: '' is_release: '' is_split_release: 'false' test_mode: '' steps: - bash: | if [ -f ci/configure-bazel.sh ]; then ci/configure-bazel.sh else sdk/ci/configure-bazel.sh fi displayName: 'Configure Bazel' env: IS_FORK: $(System.PullRequest.IsFork) # to upload to the bazel cache GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT) - powershell: | if (Test-Path .\ci\windows-diagnostics.ps1) { .\ci\windows-diagnostics.ps1 } else { cd sdk .\ci\windows-diagnostics.ps1 } displayName: 'Agent diagnostics' - bash: | set -euo pipefail if [ -e bazel-testlogs ]; then rm -rf bazel-testlogs/ fi if [ -e sdk/bazel-testlogs ]; then rm -rf sdk/bazel-testlogs fi displayName: delete old logs - powershell: | cd sdk .\build.ps1 displayName: 'Build' condition: and(succeeded(), ne('true', ${{parameters.is_release}})) env: DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}} TEST_MODE: ${{parameters.test_mode}} - powershell: | cd sdk if (Test-Path .\ci\build-release.ps1) { .\ci\build-release.ps1 } else { .\build.ps1 } displayName: 'Build Release' condition: and(succeeded(), eq('true', ${{parameters.is_release}})) env: DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}} TEST_MODE: ${{parameters.test_mode}} - template: publish-platform-independence-dar.yml parameters: platform: 'windows' is_release: '${{parameters.is_release}}' - task: PublishBuildArtifacts@1 condition: failed() displayName: 'Publish the bazel test logs' inputs: pathtoPublish: '$(Build.StagingDirectory)/bazel-testlogs/' artifactName: 'Test logs Windows' - template: bash-lib.yml parameters: var_name: bash-lib - bash: | set -euo pipefail mkdir -p '$(Build.StagingDirectory)'/release if [ -f ./ci/copy-windows-release-artifacts.sh ]; then p=. else p=sdk fi $p/ci/copy-windows-release-artifacts.sh \ ${{parameters.release_tag}} \ '$(Build.StagingDirectory)'/release \ "${{ parameters.is_split_release }}" name: publish env: AZURE_KEY_VAULT_URL: $(AZURE_KEY_VAULT_URL) AZURE_CLIENT_ID: $(AZURE_CLIENT_ID) AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET) AZURE_TENANT_ID: $(AZURE_TENANT_ID) AZURE_KEY_VAULT_CERTIFICATE: $(AZURE_KEY_VAULT_CERTIFICATE) DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}} condition: and(succeeded(), eq(${{parameters.is_release}}, 'true'), in(variables['Build.SourceBranchName'], 'main', 'main-2.x')) - task: PublishPipelineArtifact@0 condition: and(succeeded(), eq(${{parameters.is_release}}, 'true'), in(variables['Build.SourceBranchName'], 'main', 'main-2.x')) inputs: targetPath: $(Build.StagingDirectory)/release artifactName: windows-release