File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Tag and push a release.
3+
4+ set -e
5+ set -x
6+
7+ # Make sure we're in the project root.
8+
9+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && cd .. && pwd ) "
10+ cd ${DIR}
11+
12+ # Build a new gem archive.
13+
14+ rm -rf entitlements-github-plugin-* .gem
15+ gem build -q entitlements-github-plugin.gemspec
16+
17+ # Make sure we're on the main branch.
18+
19+ (git branch --no-color | grep -q ' * main' ) || {
20+ echo " Only release from the main branch."
21+ exit 1
22+ }
23+
24+ # Figure out what version we're releasing.
25+
26+ tag=v` ls entitlements-github-plugin-* .gem | sed ' s/^entitlements-github-plugin-\(.*\)\.gem$/\1/' `
27+
28+ # Make sure we haven't released this version before.
29+
30+ git fetch -t origin
31+
32+ (git tag -l | grep -q " $tag " ) && {
33+ echo " Whoops, there's already a '${tag} ' tag."
34+ exit 1
35+ }
36+
37+ # Tag it and bag it.
38+
39+ gem push entitlements-github-plugin-* .gem && git tag " $tag " &&
40+ git push origin main && git push origin " $tag "
You can’t perform that action at this time.
0 commit comments