Skip to content

Commit

Permalink
Merge pull request #4459 from esl/generate-package-link
Browse files Browse the repository at this point in the history
Generate package links
  • Loading branch information
chrzaszcz authored Jan 17, 2025
2 parents b057b61 + a56aa97 commit 5013daf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/pkg/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,23 @@ aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
aws configure set default.region $AWS_DEFAULT_REGION

generate_link() {
local type=$1
local identifier=$2
local package_name=$3
local link_package_name=$(echo "$package_name" | sed 's/^mongooseim/mim/')
echo "Package link: https://esl.github.io/circleci-mim-results/s3_packages.html?prefix=${type}/${identifier}/${link_package_name}"
}

if [ -n "$CIRCLE_TAG" ]; then
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/tags/${CIRCLE_TAG}/${PACKAGE_NAME}" --acl public-read --quiet

echo "$GH_RELEASE_TOKEN" | gh auth login --with-token
gh release upload "${CIRCLE_TAG}" "${PACKAGE_NAME}" --repo "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"

generate_link "tags" "$CIRCLE_TAG" "$PACKAGE_NAME"
else
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/branches/${CIRCLE_BRANCH}/${prefix}/${PACKAGE_NAME}" --acl public-read --quiet

generate_link "branches" "$CIRCLE_BRANCH/$prefix" "$PACKAGE_NAME"
fi

0 comments on commit 5013daf

Please sign in to comment.