Skip to content

Commit 4e37156

Browse files
committed
feat: create released tag locally as well
1 parent 869b595 commit 4e37156

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

please

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,20 +344,25 @@ fi
344344

345345
# github release
346346
trigger before-vcs
347+
347348
info "Releasing $NEXT_VERSION ..."
348349
COMMITS=$(printf %s "$COMMITS")
350+
351+
[[ $LABEL ]] && LABEL=" ($LABEL)"
352+
VERSION_INFO="Version $NEXT_VERSION${LABEL}"
353+
349354
LAST_RELEASE_ID=$(curl --silent -H "Authorization: token $GH_AUTH_TOKEN" \
350355
-H 'Content-Type: application/json' \
351-
-d "{\"tag_name\":\"$NEXT_VERSION\",\"name\":\"${LABEL:-Version} $NEXT_VERSION\",\"body\":\"$COMMITS\",\"target_commitish\":\"$DEPLOY_BRANCH\"}" \
356+
-d "{\"tag_name\":\"$NEXT_VERSION\",\"name\":\"$VERSION_INFO\",\"body\":\"$COMMITS\",\"target_commitish\":\"$DEPLOY_BRANCH\"}" \
352357
https://api.$GH_REPO/releases \
353358
| jq -r '.id?')
354359

355360
if [ "null" == "${LAST_RELEASE_ID:-null}" ]; then
356-
error "Something went wrong" && info "Check $TMP_LOG for logs" 1
361+
error "Something went wrong" && info "Check $TMP_LOG for logs" 1 # exit
357362
fi
358363

359-
RELEASE_URL="https://github.com/$REPO/releases/tag/$NEXT_VERSION"
360-
ok " Done ($RELEASE_URL)"
364+
ok " Done (https://github.com/$REPO/releases/tag/$NEXT_VERSION)"
365+
git tag -a "$NEXT_VERSION" HEAD -m "$VERSION_INFO" && echo "Created tag $NEXT_VERSION"; || true
361366
trigger after-release
362367

363368
# do we need to publish phar?

0 commit comments

Comments
 (0)