please-release-me 3.2.0 → 3.4.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/release.sh +36 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "please-release-me",
3
- "version": "3.2.0",
3
+ "version": "3.4.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
@@ -8,14 +8,16 @@ abort() {
8
8
  LAST_TAG=$(git describe --tags --abbrev=0)
9
9
  COMMITS=$(git log "$LAST_TAG..HEAD" --pretty=oneline)
10
10
 
11
+ DRY_RUN=false
11
12
  SKIP_CI=false
12
13
  TEST=true
13
14
 
14
15
  while [ $# -gt 0 ]; do
15
16
  case "$1" in
16
- --noci) SKIP_CI=true ;;
17
- --notest) TEST=false ;;
18
- *) abort "Unknown option: $1" ;;
17
+ --norelease) DRY_RUN=true ;;
18
+ --noci) SKIP_CI=true ;;
19
+ --notest) TEST=false ;;
20
+ *) abort "Unknown option: $1" ;;
19
21
  esac
20
22
  shift
21
23
  done
@@ -36,6 +38,14 @@ if [ -f Cargo.toml ]; then
36
38
  IS_RUST=true
37
39
  fi
38
40
 
41
+ if [ -f DESCRIPTION ] && grep -q '^Package:' DESCRIPTION; then
42
+ IS_R=true
43
+ R_PKG_PATH="."
44
+ elif [ -f R/DESCRIPTION ] && grep -q '^Package:' R/DESCRIPTION; then
45
+ IS_R=true
46
+ R_PKG_PATH="R"
47
+ fi
48
+
39
49
  if [ "$COMMITS" = "" ]; then
40
50
  abort "I see no work"
41
51
  fi
@@ -65,12 +75,17 @@ if [ "$TEST" = "true" ]; then
65
75
  fi
66
76
  fi
67
77
 
78
+ if [ "$IS_R" ]; then
79
+ if ! R CMD check "$R_PKG_PATH"; then
80
+ abort "R CMD check failed"
81
+ fi
82
+ fi
83
+
68
84
  if [ "$IS_RUST" ]; then
69
85
  if ! cargo t; then
70
86
  abort "cargo test failed"
71
87
  fi
72
88
  fi
73
-
74
89
  fi
75
90
 
76
91
  if grep '^\s*"minify":' package.json > /dev/null 2>&1; then
@@ -192,6 +207,11 @@ esac
192
207
 
193
208
  NEW_TAG="$MAJOR.$MINOR.$PATCH"
194
209
 
210
+ if [ "$DRY_RUN" = "true" ]; then
211
+ echo "$NEW_TAG"
212
+ exit 0
213
+ fi
214
+
195
215
  if [ -f version.go ]; then
196
216
  sed -i.release.bak -e "s/$SED_FRIENDLY_LAST_TAG/$NEW_TAG/g" version.go
197
217
  rm version.go.release.bak
@@ -226,6 +246,12 @@ if [ "$IS_PYTHON" = "true" ]; then
226
246
  MODIFIED_FILES="$MODIFIED_FILES setup.py"
227
247
  fi
228
248
 
249
+ if [ "$IS_R" = "true" ]; then
250
+ sed -i.release.bak -e "s/^Version: $SED_FRIENDLY_LAST_TAG$/Version: $NEW_TAG/" "$R_PKG_PATH/DESCRIPTION"
251
+ rm "$R_PKG_PATH/DESCRIPTION.release.bak"
252
+ MODIFIED_FILES="$MODIFIED_FILES $R_PKG_PATH/DESCRIPTION"
253
+ fi
254
+
229
255
  if [ "$IS_RUST" = "true" ]; then
230
256
  sed -i.release.bak -e "s/$SED_FRIENDLY_LAST_TAG/$NEW_TAG/g" Cargo.toml
231
257
  rm Cargo.toml.release.bak
@@ -238,18 +264,24 @@ elif [ -f CHANGES.md ]; then
238
264
  LOG="CHANGES.md"
239
265
  elif [ -f HISTORY.md ]; then
240
266
  LOG="HISTORY.md"
267
+ elif [ -f NEWS.md ]; then
268
+ LOG="NEWS.md"
241
269
  elif [ -f CHANGELOG.txt ]; then
242
270
  LOG="CHANGELOG.txt"
243
271
  elif [ -f CHANGES.txt ]; then
244
272
  LOG="CHANGES.txt"
245
273
  elif [ -f HISTORY.txt ]; then
246
274
  LOG="HISTORY.txt"
275
+ elif [ -f NEWS.txt ]; then
276
+ LOG="NEWS.txt"
247
277
  elif [ -f CHANGELOG ]; then
248
278
  LOG="CHANGELOG"
249
279
  elif [ -f CHANGES ]; then
250
280
  LOG="CHANGES"
251
281
  elif [ -f HISTORY ]; then
252
282
  LOG="HISTORY"
283
+ elif [ -f NEWS ]; then
284
+ LOG="NEWS"
253
285
  fi
254
286
 
255
287
  if [ "$LOG" != "" ]; then