Skip to content

Commit

Permalink
Align CircleCI config
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgSchneider committed Jan 7, 2023
1 parent 3760cc4 commit 29da3e6
Showing 1 changed file with 36 additions and 17 deletions.
53 changes: 36 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ commands:
command: |
set -euo pipefail
git log -n1 --format=%H nix shell.nix > /tmp/nix-cache-key
git log -n1 --format=%H nix shell.nix daml.yaml > /tmp/nix-cache-key
sudo mkdir /nix
sudo chown circleci /nix
>> $BASH_ENV echo 'export USER=circleci'
echo 'export USER=circleci' >> "$BASH_ENV"
- restore_cache:
keys:
- nix-{{ checksum "/tmp/nix-cache-key" }}
Expand Down Expand Up @@ -84,28 +84,40 @@ commands:
--run bash \<<'EOF'
set -euo pipefail
PACKAGES=(`ls package/main/daml/*/daml.yaml`)
for package in ${PACKAGES[@]}; do
PACKAGE=`echo ${package} | cut -f4 -d "/"`
VERSION=`yq e '.version' ${package}`
TAG="${PACKAGE}/${VERSION}"
echo "Processing package '${PACKAGE}' with tag '${TAG}'..."
while read PACKAGE_NAME PACKAGE_PATH
do
CONFIG="package/${PACKAGE_PATH}/daml.yaml"
VERSION=`yq e '.version' ${CONFIG}`
TAG="${PACKAGE_NAME}/${VERSION}"
echo "Processing package '${PACKAGE_NAME}' with tag '${TAG}'..."
if [[ `git tag -l ${TAG} | wc -l` -eq 0 ]]; then
DAR_PREFIX=`yq e '.name' ${package}`
DAR_PREFIX=`yq e '.name' ${CONFIG}`
DAR="${DAR_PREFIX}-${VERSION}.dar"
gpg --armor --detach-sign .dars/${DAR}
if [[ `echo $VERSION | grep ".99." | wc -l` -eq 0 ]]; then
gh release create ${TAG} .dars/${DAR}* --target ${CIRCLE_BRANCH} --notes "See release notes (insert link here) for further details."
if [[ `echo $VERSION | grep ".99." | wc -l` -eq 0 ]] ; then
gh release create ${TAG} .dars/${DAR}* \
--target ${CIRCLE_BRANCH} \
--title ${TAG} \
--notes "See [Daml Finance App readme](https://github.com/digital-asset/daml-finance-app#readme) for further details."
else
gh release create ${TAG} .dars/${DAR}* --target ${CIRCLE_BRANCH} --prerelease --notes "Development snapshot of package '${PACKAGE}'. Use at your own risk."
gh release create ${TAG} .dars/${DAR}* \
--prerelease \
--target ${CIRCLE_BRANCH} \
--title ${TAG} \
--notes "Development snapshot of package '${PACKAGE_NAME}'. Use at your own risk."
fi
echo -e "Successfully released package '${PACKAGE}' with tag '${TAG}'.\n"
echo -e "Successfully released package '${PACKAGE_NAME}' with tag '${TAG}'.\n"
else
echo -e "Tag '${TAG}' already exists for package '${PACKAGE}'; Ignoring.\n"
echo -e "Tag '${TAG}' already exists for package '${PACKAGE_NAME}'; Ignoring.\n"
fi
done
done < <(yq e '.local.packages
| to_entries
| map(.value.package)
| .[]
| select(.path == "main*")
| .name + " " + .path' package/packages.yaml)
EOF
run_release_ui:
description: "GitHub Release - currently ignored"
Expand All @@ -131,9 +143,16 @@ commands:
gpg --armor --detach-sign ${TAR}
if [[ `echo $VERSION | grep ".99." | wc -l` -eq 0 ]]; then
gh release create ${TAG} ${TAR}* --target ${CIRCLE_BRANCH} --notes "See release notes (insert link here) for further details."
gh release create ${TAG} ${TAR}* \
--target ${CIRCLE_BRANCH} \
--title ${TAG} \
--notes "See [Daml Finance App readme](https://github.com/digital-asset/daml-finance-app#readme) for further details."
else
gh release create ${TAG} ${TAR}* --target ${CIRCLE_BRANCH} --prerelease --notes "Development snapshot of the UI. Use at your own risk."
gh release create ${TAG} ${TAR}* \
--prerelease \
--target ${CIRCLE_BRANCH} \
--title ${TAG} \
--notes "Development snapshot of the UI. Use at your own risk."
fi
else
echo -e "Tag '${TAG}' already exists; Ignoring."
Expand Down

0 comments on commit 29da3e6

Please sign in to comment.