# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 parameters: is_release: '' name: '' release_tag: '' steps: - bash: ci/dev-env-install.sh displayName: 'Build/Install the Developer Environment' - bash: | source dev-env/lib/ensure-nix ci/dev-env-push.py displayName: 'Push Developer Environment build results' condition: eq(variables['System.PullRequest.IsFork'], 'False') env: # to upload to the Nix cache GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT) NIX_SECRET_KEY_CONTENT: $(NIX_SECRET_KEY_CONTENT) - bash: ci/configure-bazel.sh displayName: 'Configure Bazel' env: IS_FORK: $(System.PullRequest.IsFork) # to upload to the bazel cache GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT) - bash: ./fmt.sh --test displayName: 'Platform-agnostic lints and checks' condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) - bash: ./build.sh "_$(uname)" displayName: 'Build' env: DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}} - task: PublishBuildArtifacts@1 condition: failed() displayName: 'Publish the bazel test logs' inputs: pathtoPublish: 'bazel-testlogs/' artifactName: 'Test logs' - bash: | set -euo pipefail eval "$(./dev-env/bin/dade-assist)" mkdir -p ~/.jfrog cleanup() { rm -f ~/.jfrog/jfrog-cli.conf } trap cleanup EXIT echo "$JFROG_CONFIG_CONTENT" > ~/.jfrog/jfrog-cli.conf unset JFROG_CONFIG_CONTENT ./bazel-bin/release/release --release-dir "$(mktemp -d)" --upload env: DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}} JFROG_CONFIG_CONTENT: $(JFROG_CONFIG_CONTENT) GPG_KEY: $(gpg-code-signing) MAVEN_USERNAME: $(MAVEN_USERNAME) MAVEN_PASSWORD: $(MAVEN_PASSWORD) MAVEN_URL: "https://oss.sonatype.org" NPM_TOKEN: $(NPM_TOKEN) name: publish_npm_mvn condition: and(succeeded(), eq(${{parameters.is_release}}, 'true'), or(eq(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')), eq('${{parameters.name}}', 'linux')) - bash: | set -euo pipefail eval "$(./dev-env/bin/dade-assist)" TARBALL=daml-sdk-${{parameters.release_tag}}-${{parameters.name}}.tar.gz cp bazel-bin/release/sdk-release-tarball.tar.gz $(Build.StagingDirectory)/$TARBALL echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL" PROTOS_ZIP=protobufs-${{parameters.release_tag}}.zip cp bazel-bin/release/protobufs.zip $(Build.StagingDirectory)/$PROTOS_ZIP echo "##vso[task.setvariable variable=protos-zip;isOutput=true]$PROTOS_ZIP" name: publish condition: and(succeeded(), eq(${{parameters.is_release}}, 'true'), or(eq(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) - task: PublishPipelineArtifact@0 inputs: targetPath: $(Build.StagingDirectory)/$(publish.tarball) artifactName: $(publish.tarball) condition: and(succeeded(), eq(${{parameters.is_release}}, 'true'), or(eq(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) - task: PublishPipelineArtifact@0 inputs: targetPath: $(Build.StagingDirectory)/$(publish.protos-zip) artifactName: $(publish.protos-zip) condition: and(succeeded(), eq(${{parameters.is_release}}, 'true'), or(eq(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')), eq('${{parameters.name}}', 'linux'))