Commit 60b3f5b 1 parent e664326 commit 60b3f5b Copy full SHA for 60b3f5b
File tree 2 files changed +55
-1
lines changed
2 files changed +55
-1
lines changed Original file line number Diff line number Diff line change
1
+ require 'pathname'
2
+
3
+ class ThisProject
4
+ def self . this_file_path
5
+ Pathname . new ( __FILE__ ) . expand_path
6
+ end
7
+
8
+ def self . project_root
9
+ this_file_path . dirname
10
+ end
11
+
12
+ def self . this_file_path
13
+ Pathname . new ( __FILE__ ) . expand_path
14
+ end
15
+
16
+ def self . project_path ( *relative_path )
17
+ project_root . join ( *relative_path )
18
+ end
19
+
20
+ def self . version
21
+ path = project_path ( "init.rb" )
22
+ line = path . read [ /^\s *VERSION\s *=\s *.*/ ]
23
+ if line then
24
+ return line . match ( /.*VERSION\s *=\s *['"](.*)['"]/ ) [ 1 ]
25
+ end
26
+ end
27
+
28
+ def self . release_branch
29
+ "main"
30
+ end
31
+ end
32
+
33
+ task :version do
34
+ puts ThisProject . version
35
+ end
36
+
37
+ task :release_check do
38
+ unless `git branch` =~ /^\* #{ ThisProject . release_branch } /
39
+ abort "You must be on the #{ ThisProject . release_branch } branch to release!"
40
+ end
41
+ unless `git status` =~ /^nothing to commit/m
42
+ abort "Nope, sorry, you have unfinished business"
43
+ end
44
+ end
45
+
46
+ desc "Create tag v#{ ThisProject . version } and generate release on github"
47
+ task :release => [ :release_check ] do
48
+ sh "git commit --allow-empty -a -m 'Release #{ ThisProject . version } '"
49
+ sh "git tag -a -m 'v#{ ThisProject . version } ' v#{ ThisProject . version } "
50
+ sh "git push origin #{ ThisProject . release_branch } "
51
+ sh "git push origin v#{ ThisProject . version } "
52
+ end
Original file line number Diff line number Diff line change 9
9
10
10
require 'byebug'
11
11
12
+ VERSION = "0.5.0"
13
+
12
14
Redmine ::Plugin . register :redmine_freshbooks_sync do
13
15
name 'FreshBooks Sync'
14
16
author 'Jeremy Hinegardner'
15
17
description 'This is a Redmine // FreshBooks Synchronization tool'
16
- version '0.5.0'
18
+ version VERSION
17
19
url 'https://github.com/dojo4/redmine_freshbooks_sync'
18
20
author_url 'https://github.com/copiousfreetime'
19
21
You can’t perform that action at this time.
0 commit comments