please-release-me 2.1.5 → 3.0.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 (3) hide show
  1. package/README.md +12 -20
  2. package/package.json +3 -3
  3. package/release.sh +34 -11
package/README.md CHANGED
@@ -75,43 +75,35 @@ in order:
75
75
  * Otherwise,
76
76
  increment the patch number.
77
77
 
78
- 7. If `bower.json` exists,
79
- write the freshly bumped version string
80
- to `bower.json`.
81
-
82
- 8. If `component.json` exists,
83
- write the freshly bumped version string
84
- to `component.json`.
85
-
86
- 9. If `package.json` exists,
78
+ 7. If `package.json` exists,
87
79
  write the freshly bumped version string
88
80
  to `package.json`.
89
81
 
90
- 10. If `package-lock.json` exists,
82
+ 8. If `package-lock.json` exists,
91
83
  run `npm i`.
92
84
 
93
- 11. If `npm-shrinkwrap.json` exists,
85
+ 9. If `npm-shrinkwrap.json` exists,
94
86
  run `npm shrinkwrap`.
95
87
 
96
- 12. If `pnpm-lock.yaml` exists,
88
+ 10. If `pnpm-lock.yaml` exists,
97
89
  run `pnpm i`.
98
90
 
99
- 13. If `yarn.lock` exists,
91
+ 11. If `yarn.lock` exists,
100
92
  run `yarn`.
101
93
 
102
- 14. If `setup.py` exists,
94
+ 12. If `setup.py` exists,
103
95
  write the freshly bumped version string
104
96
  to `setup.py`.
105
97
 
106
- 15. If `Cargo.toml` exists,
98
+ 13. If `Cargo.toml` exists,
107
99
  write the freshly bumped version string
108
100
  to `Cargo.toml`.
109
101
 
110
- 16. If `Cargo.lock` exists,
102
+ 14. If `go.mod` exists,
111
103
  write the freshly bumped version string
112
- to `Cargo.lock`.
104
+ to `go.mod`.
113
105
 
114
- 17. If a change log is detected,
106
+ 15. If a change log is detected,
115
107
  write a summary of the changes
116
108
  to the change log.
117
109
  It will recognise any of the following file names:
@@ -134,7 +126,7 @@ in order:
134
126
 
135
127
  * `HISTORY`
136
128
 
137
- 18. Commit all changes
129
+ 16. Commit all changes
138
130
  made by the preceding steps.
139
131
 
140
132
  17. If `Cargo.toml` exists,
@@ -142,7 +134,7 @@ in order:
142
134
  If it fails,
143
135
  the release is aborted.
144
136
 
145
- 18. Tag the release
137
+ 18. Tag the repo
146
138
  with the freshly bumped version string.
147
139
 
148
140
  ## What doesn't it do?
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "please-release-me",
3
- "version": "2.1.5",
3
+ "version": "3.0.0",
4
4
  "description": "Let me go!",
5
5
  "author": "Phil Booth <pmbooth@gmail.com> (https://philbooth.me/)",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://gitlab.com/philbooth/please-release-me.git"
9
+ "url": "git+https://gitlab.com/philbooth/please-release-me.git"
10
10
  },
11
11
  "homepage": "https://gitlab.com/philbooth/please-release-me#readme",
12
12
  "bugs": {
13
13
  "url": "https://gitlab.com/philbooth/please-release-me/issues"
14
14
  },
15
15
  "bin": {
16
- "release": "./release.sh"
16
+ "release": "release.sh"
17
17
  },
18
18
  "keywords": [
19
19
  "release",
package/release.sh CHANGED
@@ -37,6 +37,24 @@ fi
37
37
 
38
38
  if [ -f Cargo.toml ]; then
39
39
  cargo t
40
+ if [ $? -ne 0 ]; then
41
+ echo "Release aborted: Cargo tests failed."
42
+ exit 1
43
+ fi
44
+ fi
45
+
46
+ if [ -f go.mod ]; then
47
+ go vet ./...
48
+ if [ $? -ne 0 ]; then
49
+ echo "Release aborted: Go vet failed."
50
+ exit 1
51
+ fi
52
+
53
+ go test ./...
54
+ if [ $? -ne 0 ]; then
55
+ echo "Release aborted: Go tests failed."
56
+ exit 1
57
+ fi
40
58
  fi
41
59
 
42
60
  while read -r COMMIT; do
@@ -150,41 +168,44 @@ esac
150
168
 
151
169
  NEW_TAG="$MAJOR.$MINOR.$PATCH"
152
170
 
153
- if [ -f bower.json ]; then
154
- sed -i.release.bak -e "s/\"version\": \"$LAST_TAG\"/\"version\": \"$NEW_TAG\"/" bower.json
155
- rm bower.json.release.bak
156
- fi
157
-
158
- if [ -f component.json ]; then
159
- sed -i.release.bak -e "s/\"version\": \"$LAST_TAG\"/\"version\": \"$NEW_TAG\"/" component.json
160
- rm component.json.release.bak
161
- fi
162
-
163
171
  if [ -f package.json ]; then
164
172
  sed -i.release.bak -e "s/\"version\": \"$LAST_TAG\"/\"version\": \"$NEW_TAG\"/" package.json
165
173
  rm package.json.release.bak
174
+ MODIFIED_FILES="$MODIFIED_FILES package.json"
166
175
  fi
167
176
 
168
177
  if [ -f package-lock.json ]; then
169
178
  npm i
179
+ MODIFIED_FILES="$MODIFIED_FILES package-lock.json"
170
180
 
171
181
  if [ -f npm-shrinkwrap.json ]; then
172
182
  npm shrinkwrap
183
+ MODIFIED_FILES="$MODIFIED_FILES npm-shrinkwrap.json"
173
184
  fi
174
185
  elif [ -f pnpm-lock.yaml ]; then
175
186
  pnpm i
187
+ MODIFIED_FILES="$MODIFIED_FILES pnpm-lock.yaml"
176
188
  elif [ -f yarn.lock ]; then
177
189
  yarn
190
+ MODIFIED_FILES="$MODIFIED_FILES yarn.lock"
178
191
  fi
179
192
 
180
193
  if [ -f setup.py ]; then
181
194
  sed -i.release.bak -e "s/$SED_FRIENDLY_LAST_TAG/$NEW_TAG/g" setup.py
182
195
  rm setup.py.release.bak
196
+ MODIFIED_FILES="$MODIFIED_FILES setup.py"
183
197
  fi
184
198
 
185
199
  if [ -f Cargo.toml ]; then
186
200
  sed -i.release.bak -e "s/$SED_FRIENDLY_LAST_TAG/$NEW_TAG/g" Cargo.toml
187
201
  rm Cargo.toml.release.bak
202
+ MODIFIED_FILES="$MODIFIED_FILES Cargo.toml"
203
+ fi
204
+
205
+ if [ -f version.go ]; then
206
+ sed -i.release.bak -e "s/$SED_FRIENDLY_LAST_TAG/$NEW_TAG/g" version.go
207
+ rm version.go.release.bak
208
+ MODIFIED_FILES="$MODIFIED_FILES version.go"
188
209
  fi
189
210
 
190
211
  if [ -f CHANGELOG.md ]; then
@@ -211,11 +232,13 @@ if [ "$LOG" != "" ]; then
211
232
  TEMP="__please_release_me_$LOG.$NEW_TAG.tmp"
212
233
  awk "{ gsub(/^## $LAST_TAG$/, \"## $NEW_TAG\n\n$SUMMARY## $LAST_TAG\") }; { print }" "$LOG" > "$TEMP"
213
234
  mv "$TEMP" "$LOG"
235
+ MODIFIED_FILES="$MODIFIED_FILES $LOG"
214
236
  fi
215
237
 
216
238
  GIT_FRIENDLY_SUMMARY=`echo "$SUMMARY" | sed "s/#//g" | sed "s/^ //"`
217
239
 
218
- git commit -a -m "release: $NEW_TAG"
240
+ git add $MODIFIED_FILES
241
+ git commit -m "release: $NEW_TAG"
219
242
 
220
243
  if [ -f Cargo.toml ]; then
221
244
  cargo package