release-me-sh 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-me-sh",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "author": "Davlatjon Shavkatov <opensource@dalisoft.uz>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,16 +12,16 @@ release() {
12
12
  log_verbose "GitHub release hash: $CHECKOUT_SHA!"
13
13
 
14
14
  if ! $IS_DRY_RUN; then
15
- curl -s -o /dev/null \
16
- -L \
17
- -X POST \
18
- -H "Accept: application/vnd.github+json" \
19
- -H "Authorization: Bearer $GITHUB_TOKEN" \
20
- -H "X-GitHub-Api-Version: 2022-11-28" \
21
- "https://api.github.com/repos/$GIT_REPO_NAME/releases" \
22
- -d "{\"tag_name\":\"$NEXT_RELEASE_TAG\",\"name\":\"$NEXT_RELEASE_TAG\",\"body\":\"$RELEASE_BODY\",\"draft\":false,\"prerelease\":$PRE_RELEASE_VERSION,\"generate_release_notes\":false,\"make_latest\":\"true\"}"
23
- log "Created GitHub release [$NEXT_RELEASE_TAG]!"
24
- log "GitHub release available at https://github.com/$GIT_REPO_NAME/releases/tag/$NEXT_RELEASE_TAG"
15
+ if ! command -v gh; then
16
+ echo "GitHub CLI not found your machine"
17
+ return 1
18
+ fi
19
+
20
+ if $PRE_RELEASE_VERSION; then
21
+ printf "%b" "${RELEASE_BODY-}" | gh release create "${NEXT_RELEASE_TAG-}" --title "${NEXT_RELEASE_TAG-}" --prerelease --notes-file -
22
+ else
23
+ printf "%b" "${RELEASE_BODY-}" | gh release create "${NEXT_RELEASE_TAG-}" --title "${NEXT_RELEASE_TAG-}" --latest --notes-file -
24
+ fi
25
25
  else
26
26
  log "Skipped GitHub release [$NEXT_RELEASE_TAG] in DRY-RUN mode."
27
27
  fi