We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
release
1 parent 9be73b1 commit 7df1df2Copy full SHA for 7df1df2
1 file changed
script/release
@@ -0,0 +1,27 @@
1
+#!/bin/bash
2
+# Edit the version string in the gemspec, then execute this script to:
3
+#
4
+# 1. Commit the version change
5
+# 2. Tag the release
6
+# 3. Push the tag and the current branch to GitHub
7
+# 4. Publish the gem to RubyGems
8
9
+set -eu
10
+
11
+fields=( $(gem build *.gemspec | awk '/Name:|Version:/ {print $2}') )
12
+name="${fields[0]}"
13
+version="${fields[1]}"
14
+gem="${name}-${version}.gem"
15
+[ -n "$version" ] || exit 1
16
+trap "rm -f '$gem'" EXIT
17
18
+bundle install
19
+script/test
20
21
+if ! git rev-parse --verify --quiet "refs/tags/v${version}" >/dev/null; then
22
+ git commit --allow-empty -a -m "$name $version"
23
+ git tag "v${version}"
24
+fi
25
26
+git push origin HEAD "v${version}"
27
+gem push "$gem"
0 commit comments