please-release-me 3.1.0 → 3.2.0

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git show:*)",
5
+ "WebSearch",
6
+ "WebFetch(domain:docs.github.com)"
7
+ ]
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "please-release-me",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Let me go!",
5
5
  "author": "Phil Booth <pmbooth@gmail.com> (https://philbooth.me/)",
6
6
  "license": "MIT",
package/release.sh CHANGED
@@ -1,13 +1,24 @@
1
1
  #!/bin/sh
2
2
 
3
+ abort() {
4
+ echo "Release aborted: $1"
5
+ exit 1
6
+ }
7
+
3
8
  LAST_TAG=$(git describe --tags --abbrev=0)
4
9
  COMMITS=$(git log "$LAST_TAG..HEAD" --pretty=oneline)
5
10
 
6
- if [ "$1" = "--notest" ]; then
7
- TEST=false
8
- else
9
- TEST=true
10
- fi
11
+ SKIP_CI=false
12
+ TEST=true
13
+
14
+ while [ $# -gt 0 ]; do
15
+ case "$1" in
16
+ --noci) SKIP_CI=true ;;
17
+ --notest) TEST=false ;;
18
+ *) abort "Unknown option: $1" ;;
19
+ esac
20
+ shift
21
+ done
11
22
 
12
23
  if [ -f go.mod ]; then
13
24
  IS_GO=true
@@ -25,11 +36,6 @@ if [ -f Cargo.toml ]; then
25
36
  IS_RUST=true
26
37
  fi
27
38
 
28
- abort() {
29
- echo "Release aborted: $1"
30
- exit 1
31
- }
32
-
33
39
  if [ "$COMMITS" = "" ]; then
34
40
  abort "I see no work"
35
41
  fi
@@ -53,7 +59,7 @@ if [ "$TEST" = "true" ]; then
53
59
  fi
54
60
  fi
55
61
 
56
- if grep '^\s*"minify":' package.json > /dev/null 2>&1; then
62
+ if grep '^\s*"test":' package.json > /dev/null 2>&1; then
57
63
  if ! npm t; then
58
64
  abort "npm test failed"
59
65
  fi
@@ -257,11 +263,17 @@ GIT_FRIENDLY_SUMMARY=$(echo "$SUMMARY" | sed "s/#//g" | sed "s/^ //")
257
263
 
258
264
  # shellcheck disable=SC2086
259
265
  git add $MODIFIED_FILES
260
- git commit -m "release: $NEW_TAG"
266
+ if [ "$SKIP_CI" = "true" ]; then
267
+ git commit -m "release: $NEW_TAG
268
+
269
+ [skip ci]"
270
+ else
271
+ git commit -m "release: $NEW_TAG"
272
+ fi
261
273
 
262
274
  if [ -f Cargo.toml ]; then
263
275
  cargo package
264
276
  fi
265
277
 
266
- git tag -a "$NEW_TAG" -m "$BUILD_TYPE release $NEW_TAG\n\n$GIT_FRIENDLY_SUMMARY"
278
+ git tag -a "$NEW_TAG" -m "$(printf '%b' "$BUILD_TYPE release $NEW_TAG\n\n$GIT_FRIENDLY_SUMMARY")"
267
279