Skip to content

Commit a56aa97

Browse files
committed
Generate package links
1 parent b057b61 commit a56aa97

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/pkg/publish.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,23 @@ aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
1818
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
1919
aws configure set default.region $AWS_DEFAULT_REGION
2020

21+
generate_link() {
22+
local type=$1
23+
local identifier=$2
24+
local package_name=$3
25+
local link_package_name=$(echo "$package_name" | sed 's/^mongooseim/mim/')
26+
echo "Package link: https://esl.github.io/circleci-mim-results/s3_packages.html?prefix=${type}/${identifier}/${link_package_name}"
27+
}
28+
2129
if [ -n "$CIRCLE_TAG" ]; then
2230
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/tags/${CIRCLE_TAG}/${PACKAGE_NAME}" --acl public-read --quiet
2331

2432
echo "$GH_RELEASE_TOKEN" | gh auth login --with-token
2533
gh release upload "${CIRCLE_TAG}" "${PACKAGE_NAME}" --repo "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
34+
35+
generate_link "tags" "$CIRCLE_TAG" "$PACKAGE_NAME"
2636
else
2737
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/branches/${CIRCLE_BRANCH}/${prefix}/${PACKAGE_NAME}" --acl public-read --quiet
38+
39+
generate_link "branches" "$CIRCLE_BRANCH/$prefix" "$PACKAGE_NAME"
2840
fi

0 commit comments

Comments
 (0)