2024-01-15 22:27:42 +03:00
|
|
|
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2022-02-03 22:05:35 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
pr: none
|
|
|
|
trigger: none
|
|
|
|
|
2022-06-03 12:40:48 +03:00
|
|
|
parameters:
|
|
|
|
- name: version
|
|
|
|
type: string
|
|
|
|
default: snapshot
|
|
|
|
- name: commit
|
|
|
|
type: string
|
|
|
|
default: HEAD
|
|
|
|
|
2022-02-03 22:05:35 +03:00
|
|
|
jobs:
|
|
|
|
- job: check_for_release
|
|
|
|
pool:
|
|
|
|
name: "ubuntu_20_04"
|
|
|
|
demands: assignment -equals default
|
|
|
|
steps:
|
|
|
|
- template: bash-lib.yml
|
|
|
|
parameters:
|
|
|
|
var_name: bash-lib
|
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
2024-03-22 04:27:46 +03:00
|
|
|
cd sdk
|
2022-02-03 22:05:35 +03:00
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
|
|
|
source $(bash-lib)
|
|
|
|
|
2024-03-28 13:22:50 +03:00
|
|
|
prefix=$(git show ${{ parameters.commit }}:sdk/NIGHTLY_PREFIX)
|
2022-06-03 12:40:48 +03:00
|
|
|
if [ "${{ parameters.version }}" = "snapshot" ]; then
|
2024-03-28 13:22:50 +03:00
|
|
|
release=$(./release.sh snapshot ${{ parameters.commit }} $prefix | awk '{print $2}')
|
2022-06-03 12:40:48 +03:00
|
|
|
else
|
|
|
|
release=${{ parameters.version }}
|
|
|
|
fi
|
2022-02-03 22:05:35 +03:00
|
|
|
|
2022-03-04 14:16:01 +03:00
|
|
|
ERR=$(mktemp)
|
|
|
|
OUT=$(curl https://digitalasset.jfrog.io/artifactory/api/storage/assembly/daml/$release \
|
|
|
|
-u $AUTH \
|
|
|
|
-I \
|
|
|
|
2>$ERR)
|
|
|
|
STATUS=$(echo "$OUT" | head -1 | sed 's:HTTP/1.1 \([^ ]\+\).*:\1:')
|
|
|
|
case "$STATUS" in
|
|
|
|
200)
|
|
|
|
echo "Version $release already exists on Artifactory, aborting."
|
|
|
|
setvar is_release false
|
|
|
|
;;
|
|
|
|
404)
|
|
|
|
setvar is_release true
|
2022-06-03 12:40:48 +03:00
|
|
|
setvar trigger_sha $(git rev-parse HEAD)
|
|
|
|
setvar release_sha $(git rev-parse ${{ parameters.commit }})
|
|
|
|
setvar release_tag $release
|
2022-03-04 14:16:01 +03:00
|
|
|
setvar split_release_process true
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unexpected status code: $STATUS"
|
|
|
|
echo "curl stdout:"
|
|
|
|
echo "--"
|
|
|
|
echo "$OUT"
|
|
|
|
echo "--"
|
|
|
|
echo "curl stderr:"
|
|
|
|
echo "--"
|
|
|
|
echo "$ERR"
|
|
|
|
echo "--"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2022-02-03 22:05:35 +03:00
|
|
|
setvar scala_2_13 true
|
|
|
|
name: out
|
2022-03-04 14:16:01 +03:00
|
|
|
env:
|
|
|
|
AUTH: $(ARTIFACTORY_USERNAME):$(ARTIFACTORY_PASSWORD)
|
2022-02-03 22:37:11 +03:00
|
|
|
- template: build.yml
|
2023-12-04 12:52:33 +03:00
|
|
|
parameters:
|
|
|
|
test_mode: main
|
2022-02-03 22:37:11 +03:00
|
|
|
- template: split-release-job.yml
|
|
|
|
- job: release
|
|
|
|
condition: false
|