Skip to content

Commit

Permalink
Publishing packages on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekwegr committed Dec 24, 2024
1 parent bf50db9 commit c90c65b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ filters:
- &all_tags_and_master
<<: *all_tags
branches:
only: master
only: publish-packages-gh

workflows:
version: 2
Expand Down
12 changes: 12 additions & 0 deletions tools/pkg/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,20 @@ 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

if which gh > /dev/null ; then
echo "GitHub CLI ready"
else
echo "Installing GitHub CLI"
sudo apt update
sudo apt install gh -y
fi

echo "$GH_RELEASE_TOKEN" | gh auth login --with-token

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

gh release upload "$CIRCLE_TAG" "${PACKAGE_NAME}" --repo "$GITHUB_REPOSITORY"
else
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/branches/${CIRCLE_BRANCH}/${prefix}/${PACKAGE_NAME}" --acl public-read --quiet
fi

0 comments on commit c90c65b

Please sign in to comment.