2021-01-01 21:49:51 +03:00
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2020-02-06 14:54:07 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2019-04-04 11:33:38 +03:00
|
|
|
# Azure Pipelines file, see https://aka.ms/yaml
|
|
|
|
|
|
|
|
# Enable builds on all branches
|
|
|
|
trigger:
|
|
|
|
# Build every commit as our release process relies on
|
|
|
|
# the release process being built alone.
|
|
|
|
batch: false
|
|
|
|
branches:
|
|
|
|
include:
|
2020-12-27 16:19:07 +03:00
|
|
|
- main
|
2020-04-16 18:50:55 +03:00
|
|
|
- release/*
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2020-12-27 16:19:07 +03:00
|
|
|
# Enable PR triggers that target the main branch
|
2021-01-04 22:45:30 +03:00
|
|
|
pr: none
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-01-04 22:45:30 +03:00
|
|
|
- template: ci/build.yml
|
|
|
|
|
|
|
|
- job: release
|
2021-06-11 08:53:50 +03:00
|
|
|
dependsOn: [ "check_for_release", "Linux", "macOS", "Windows" ]
|
2021-01-04 22:45:30 +03:00
|
|
|
condition: and(succeeded(),
|
|
|
|
eq(dependencies.check_for_release.outputs['out.is_release'], 'true'),
|
|
|
|
eq(variables['Build.SourceBranchName'], 'main'))
|
|
|
|
pool:
|
2021-05-31 12:18:56 +03:00
|
|
|
name: 'ubuntu_20_04'
|
|
|
|
demands: assignment -equals default
|
2021-01-04 22:45:30 +03:00
|
|
|
variables:
|
|
|
|
release_sha: $[ dependencies.check_for_release.outputs['out.release_sha'] ]
|
|
|
|
release_tag: $[ dependencies.check_for_release.outputs['out.release_tag'] ]
|
|
|
|
trigger_sha: $[ dependencies.check_for_release.outputs['out.trigger_sha'] ]
|
|
|
|
steps:
|
|
|
|
- template: ci/report-start.yml
|
|
|
|
- checkout: self
|
|
|
|
persistCredentials: true
|
2021-03-14 15:58:21 +03:00
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
|
|
|
git checkout $(release_sha)
|
|
|
|
name: checkout_release
|
2021-02-09 13:42:34 +03:00
|
|
|
- template: ci/bash-lib.yml
|
|
|
|
parameters:
|
|
|
|
var_name: bash-lib
|
2020-05-07 14:53:22 +03:00
|
|
|
- bash: |
|
2021-01-04 22:45:30 +03:00
|
|
|
set -euo pipefail
|
2021-02-09 13:42:34 +03:00
|
|
|
source $(bash-lib)
|
2021-01-04 22:45:30 +03:00
|
|
|
if git tag v$(release_tag) $(release_sha); then
|
|
|
|
git push origin v$(release_tag)
|
2021-03-11 13:44:02 +03:00
|
|
|
mkdir $(Build.StagingDirectory)/release-artifacts
|
2020-05-07 14:53:22 +03:00
|
|
|
else
|
2021-02-09 13:42:34 +03:00
|
|
|
setvar skip-github TRUE
|
2020-05-07 14:53:22 +03:00
|
|
|
fi
|
2021-01-04 22:45:30 +03:00
|
|
|
- task: DownloadPipelineArtifact@0
|
|
|
|
inputs:
|
2021-03-11 13:44:02 +03:00
|
|
|
artifactName: linux-release
|
|
|
|
targetPath: $(Build.StagingDirectory)/release-artifacts
|
2021-03-17 12:46:02 +03:00
|
|
|
condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
|
2021-01-04 22:45:30 +03:00
|
|
|
- task: DownloadPipelineArtifact@0
|
|
|
|
inputs:
|
2021-03-11 13:44:02 +03:00
|
|
|
artifactName: macos-release
|
|
|
|
targetPath: $(Build.StagingDirectory)/release-artifacts
|
2021-03-17 12:46:02 +03:00
|
|
|
condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
|
2021-01-04 22:45:30 +03:00
|
|
|
- task: DownloadPipelineArtifact@0
|
|
|
|
inputs:
|
2021-03-11 13:44:02 +03:00
|
|
|
artifactName: windows-release
|
|
|
|
targetPath: $(Build.StagingDirectory)/release-artifacts
|
2021-03-17 12:46:02 +03:00
|
|
|
condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
|
2021-01-04 22:45:30 +03:00
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
|
|
|
KEY_FILE=$(mktemp)
|
|
|
|
GPG_DIR=$(mktemp -d)
|
|
|
|
cleanup() {
|
|
|
|
rm -rf $KEY_FILE $GPG_DIR
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
echo "$GPG_KEY" | base64 -d > $KEY_FILE
|
|
|
|
gpg --homedir $GPG_DIR --no-tty --quiet --import $KEY_FILE
|
2021-03-11 13:44:02 +03:00
|
|
|
cd $(Build.StagingDirectory)/release-artifacts/github
|
2021-01-04 22:45:30 +03:00
|
|
|
sha256sum $(find . -type f | sort) > sha256sums
|
|
|
|
# Note: relies on our release artifacts not having spaces in their
|
|
|
|
# names. Creates a ${f}.asc with the signature for each $f.
|
|
|
|
for f in *; do
|
|
|
|
gpg --homedir $GPG_DIR -ab $f
|
|
|
|
done
|
|
|
|
cd ../artifactory
|
|
|
|
for f in *; do
|
|
|
|
gpg --homedir $GPG_DIR -ab $f
|
|
|
|
done
|
|
|
|
env:
|
|
|
|
GPG_KEY: $(gpg-code-signing)
|
|
|
|
- task: GitHubRelease@0
|
|
|
|
inputs:
|
|
|
|
gitHubConnection: 'garyverhaegen-da'
|
|
|
|
repositoryName: '$(Build.Repository.Name)'
|
|
|
|
action: 'create'
|
|
|
|
target: '$(release_sha)'
|
|
|
|
tagSource: 'manual'
|
|
|
|
tag: 'v$(release_tag)'
|
2021-03-11 13:44:02 +03:00
|
|
|
assets: $(Build.StagingDirectory)/release-artifacts/github/*
|
2021-01-04 22:45:30 +03:00
|
|
|
assetUploadMode: 'replace'
|
|
|
|
title: '$(release_tag)'
|
|
|
|
addChangeLog: false
|
|
|
|
isPrerelease: true
|
|
|
|
releaseNotesSource: 'input'
|
|
|
|
releaseNotes: "This is a pre-release. Use at your own risk."
|
2021-03-17 12:46:02 +03:00
|
|
|
condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
|
2021-01-04 22:45:30 +03:00
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
2021-03-11 13:44:02 +03:00
|
|
|
./ci/publish-artifactory.sh $(Build.StagingDirectory) $(release_tag)
|
2021-01-04 22:45:30 +03:00
|
|
|
env:
|
2021-02-09 13:36:15 +03:00
|
|
|
AUTH: $(ARTIFACTORY_USERNAME):$(ARTIFACTORY_PASSWORD)
|
2021-03-17 12:46:02 +03:00
|
|
|
condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
|
2020-06-24 18:02:12 +03:00
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
2020-08-14 12:35:57 +03:00
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
source $(bash-lib)
|
2020-07-15 11:42:16 +03:00
|
|
|
|
2021-03-12 13:39:56 +03:00
|
|
|
cd $(Build.StagingDirectory)/release-artifacts/github
|
2021-01-04 22:45:30 +03:00
|
|
|
for f in *; do
|
|
|
|
gcs "$GCRED" cp "$f" "gs://daml-data/releases/$(release_tag)/github/$f"
|
2020-07-13 16:52:50 +03:00
|
|
|
done
|
|
|
|
|
2021-03-12 13:39:56 +03:00
|
|
|
cd $(Build.StagingDirectory)/release-artifacts/artifactory
|
2021-01-04 22:45:30 +03:00
|
|
|
for f in *; do
|
|
|
|
gcs "$GCRED" cp "$f" "gs://daml-data/releases/$(release_tag)/artifactory/$f"
|
|
|
|
done
|
|
|
|
name: backup_to_gcs
|
|
|
|
env:
|
|
|
|
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
2021-03-17 12:46:02 +03:00
|
|
|
condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE')))
|
2021-01-04 22:45:30 +03:00
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
2021-01-13 16:44:23 +03:00
|
|
|
msg=$(git log -n1 --format=%b HEAD | head -1)
|
2021-03-10 20:12:14 +03:00
|
|
|
# Keep this line in sync with RELEASE_PR_NOTIF in ci/cron/wednesday.yml
|
|
|
|
if [ "$msg" = "This PR has been created by a script, which is not very smart" ]; then
|
2021-03-10 14:38:12 +03:00
|
|
|
pr_handler="<@$(head -1 release/rotation | awk '{print $1}')>"
|
2021-01-13 16:44:23 +03:00
|
|
|
else
|
2021-03-05 16:55:58 +03:00
|
|
|
pr_handler=""
|
2021-01-13 16:44:23 +03:00
|
|
|
fi
|
2021-01-04 22:45:30 +03:00
|
|
|
curl -XPOST \
|
|
|
|
-i \
|
|
|
|
-H 'Content-Type: application/json' \
|
2021-03-10 14:38:12 +03:00
|
|
|
--data "{\"text\":\"${pr_handler} Release \`$(release_tag)\` is ready for testing. See <https://github.com/digital-asset/daml/blob/main/release/RELEASE.md|release instructions>. (<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|build>, <https://github.com/digital-asset/daml/commit/$(trigger_sha)|trigger commit>, <https://github.com/digital-asset/daml/commit/$(release_sha)|target commit>)\"}" \
|
2021-01-04 22:45:30 +03:00
|
|
|
$(Slack.team-daml)
|
2020-07-13 16:52:50 +03:00
|
|
|
- template: ci/tell-slack-failed.yml
|
|
|
|
parameters:
|
|
|
|
trigger_sha: '$(trigger_sha)'
|
2021-01-04 22:45:30 +03:00
|
|
|
- template: ci/report-end.yml
|
|
|
|
|
|
|
|
- job: compat_versions_pr
|
|
|
|
dependsOn:
|
|
|
|
- git_sha
|
|
|
|
- release
|
|
|
|
- check_for_release
|
|
|
|
pool:
|
2021-01-27 19:38:34 +03:00
|
|
|
name: ubuntu_20_04
|
2021-01-04 22:45:30 +03:00
|
|
|
demands: assignment -equals default
|
|
|
|
variables:
|
|
|
|
release_tag: $[ dependencies.check_for_release.outputs['out.release_tag'] ]
|
|
|
|
branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ]
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
persistCredentials: true
|
|
|
|
- bash: ci/dev-env-install.sh
|
|
|
|
- template: ci/bash-lib.yml
|
|
|
|
parameters:
|
|
|
|
var_name: bash_lib
|
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
|
|
|
|
2021-06-02 19:06:56 +03:00
|
|
|
## refresh tags, in case someone deleted one
|
|
|
|
git fetch --prune --prune-tags
|
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
source $(bash_lib)
|
|
|
|
|
|
|
|
DELAY=1
|
|
|
|
while ! curl --fail -I https://repo1.maven.org/maven2/com/daml/ledger-api-test-tool/$(release_tag)/ledger-api-test-tool-$(release_tag).jar; do
|
|
|
|
sleep $DELAY
|
|
|
|
DELAY=$(( DELAY * 2 ))
|
|
|
|
if (( $DELAY > 2000 )); then
|
|
|
|
echo "Too many attempts waiting for Maven."
|
2019-07-10 22:52:50 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2021-01-04 22:45:30 +03:00
|
|
|
done
|
2020-08-19 14:58:56 +03:00
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
trap "git checkout $(branch_sha)" EXIT
|
|
|
|
git checkout origin/main
|
|
|
|
cp .bazelrc compatibility/
|
|
|
|
compatibility/update-versions.sh
|
|
|
|
git add compatibility/versions.bzl compatibility/maven_install.json
|
2020-08-19 14:58:56 +03:00
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
BRANCH=update-compat-versions-for-$(release_tag)-$(Build.BuildId)
|
|
|
|
TITLE="update compat versions for $(release_tag)"
|
|
|
|
open_pr "$BRANCH" "$TITLE"
|
2020-08-12 14:29:55 +03:00
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
setvar "branch" "$BRANCH"
|
|
|
|
name: out
|
2020-08-12 14:29:55 +03:00
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
- template: ci/tell-slack-failed.yml
|
|
|
|
parameters:
|
|
|
|
trigger_sha: '$(trigger_sha)'
|
|
|
|
|
|
|
|
- job: compat_versions_pr_trigger_daily
|
|
|
|
dependsOn: compat_versions_pr
|
|
|
|
pool:
|
2021-01-05 12:39:59 +03:00
|
|
|
vmImage: "ubuntu-18.04"
|
2021-01-04 22:45:30 +03:00
|
|
|
variables:
|
|
|
|
branch: $[ dependencies.compat_versions_pr.outputs['out.branch'] ]
|
|
|
|
steps:
|
|
|
|
- checkout: none
|
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
|
|
|
az extension add --name azure-devops
|
|
|
|
echo "$(System.AccessToken)" | az devops login --org "https://dev.azure.com/digitalasset"
|
|
|
|
az pipelines build queue --branch $(branch) --definition-name "digital-asset.daml-daily-compat" --org "https://dev.azure.com/digitalasset" --project daml
|
2021-01-13 14:30:17 +03:00
|
|
|
az pipelines build queue --branch $(branch) --definition-name "PRs" --org "https://dev.azure.com/digitalasset" --project daml
|