Skip to content

Commit

Permalink
Temporary: Use github-release command from before ys refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Apr 18, 2024
1 parent ee726be commit eba29e1
Showing 1 changed file with 19 additions and 37 deletions.
56 changes: 19 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,43 +275,25 @@ jobs:
- run:
name: Publish Release on GitHub
command: |
EXTRA_RELEASE_OPTIONS=''
if [[ $CIRCLE_TAG =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "Publishing GitHub Release: $CIRCLE_TAG"
else
echo "Publishing GitHub Prerelease: $CIRCLE_TAG"
EXTRA_RELEASE_OPTIONS=-prerelease
fi
[[ $CIRCLE_TAG =~ ^v([0-9]+\.[0-9]+\.[0-9]+) ]] || exit
TAG_VERSION=${BASH_REMATCH[1]}
BODY=$(awk '
/^## \['"$TAG_VERSION"'\]/, started &&
/^##/ {
started=1;
if ($0 !~ /(^#|^\s*$)/) {
gsub(/["$]/, "\\\\&");
print
}
}' CHANGELOG.md)
echo $'Changes: \n'"$BODY"
if [[ $IS_LOCAL == YES ]]; then
GHR_CMD='echo'
else
GHR_CMD=ghr
fi
${GHR_CMD} -t "$GITHUB_TOKEN" "$EXTRA_RELEASE_OPTIONS" \
-u "$CIRCLE_PROJECT_USERNAME" \
-r "$CIRCLE_PROJECT_REPONAME" \
-b "$BODY" \
-c "$CIRCLE_SHA1" \
-delete "$CIRCLE_TAG" \
/tmp/artifacts/
EXTRA_RELEASE_OPTIONS=""
if [[ "${CIRCLE_TAG}" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]
then
echo "Publishing GitHub Release: ${CIRCLE_TAG}"
else
echo "Publishing GitHub Prerelease: ${CIRCLE_TAG}"
EXTRA_RELEASE_OPTIONS=-prerelease
fi
[[ "${CIRCLE_TAG}" =~ ^v([0-9]+\.[0-9]+\.[0-9]+) ]]
TAG_VERSION=${BASH_REMATCH[1]}
BODY=$(awk '/^## \['${TAG_VERSION}'\]/, started && /^##/ { started=1; if ($0 !~ /(^#|^\s*$)/) { gsub(/["$]/, "\\\\&"); print } }' CHANGELOG.md)
echo Changes: "\n" $BODY
if [ "${IS_LOCAL}" = YES ]
then
GHR_CMD=echo
else
GHR_CMD=ghr
fi
${GHR_CMD} -t ${GITHUB_TOKEN} ${EXTRA_RELEASE_OPTIONS} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -b "${BODY}" -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} /tmp/artifacts/
marketplace-publish:
docker:
- image: circleci/node:latest
Expand Down

0 comments on commit eba29e1

Please sign in to comment.