Skip to content

Commit

Permalink
feat: create released tag locally as well
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Oct 20, 2021
1 parent 869b595 commit 4e37156
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions please
Original file line number Diff line number Diff line change
Expand Up @@ -344,20 +344,25 @@ fi

# github release
trigger before-vcs

info "Releasing $NEXT_VERSION ..."
COMMITS=$(printf %s "$COMMITS")

[[ $LABEL ]] && LABEL=" ($LABEL)"
VERSION_INFO="Version $NEXT_VERSION${LABEL}"

LAST_RELEASE_ID=$(curl --silent -H "Authorization: token $GH_AUTH_TOKEN" \
-H 'Content-Type: application/json' \
-d "{\"tag_name\":\"$NEXT_VERSION\",\"name\":\"${LABEL:-Version} $NEXT_VERSION\",\"body\":\"$COMMITS\",\"target_commitish\":\"$DEPLOY_BRANCH\"}" \
-d "{\"tag_name\":\"$NEXT_VERSION\",\"name\":\"$VERSION_INFO\",\"body\":\"$COMMITS\",\"target_commitish\":\"$DEPLOY_BRANCH\"}" \
https://api.$GH_REPO/releases \
| jq -r '.id?')

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

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

# do we need to publish phar?
Expand Down

0 comments on commit 4e37156

Please sign in to comment.