-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.bash
More file actions
executable file
·46 lines (38 loc) · 1.16 KB
/
release.bash
File metadata and controls
executable file
·46 lines (38 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# generated with CMTools 0.0.40 72865be
#
# Release script for CMTools on GitHub using gh cli.
#
# shellcheck disable=SC2046
REPO_ID="$(basename $(pwd))"
# shellcheck disable=SC2046
GROUP_ID="$(basename $(dirname $(pwd)))"
REPO_URL="https://github.com/${GROUP_ID}/${REPO_ID}"
echo "REPO_URL -> ${REPO_URL}"
#
# Generate a new draft release jq and gh
#
RELEASE_TAG="v$(jq -r .version codemeta.json)"
RELEASE_NOTES="$(jq -r .releaseNotes codemeta.json | tr '\`' "'" | tr '\n' ' ')"
echo "tag: ${RELEASE_TAG}, notes:"
jq -r .releaseNotes codemeta.json >release_notes.tmp
cat release_notes.tmp
# Now we're ready to push things.
# shellcheck disable=SC2162
read -r -p "Push release to GitHub with gh? (y/N) " YES_NO
if [ "$YES_NO" = "y" ]; then
make save msg="prep for ${RELEASE_TAG}, ${RELEASE_NOTES}"
# Now generate a draft release
echo "Pushing release ${RELEASE_TAG} to GitHub"
gh release create "${RELEASE_TAG}" \
--draft \
-F release_notes.tmp \
--generate-notes
echo "Uploading distribution files"
gh release upload "${RELEASE_TAG}" dist/*.zip
cat <<EOT
Now goto repo release and finalize draft.
${REPO_URL}/releases
EOT
rm release_notes.tmp
fi