capistrano-github-releases 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e103dc7c2efc4537c923fd64894aaa4ccb856488
4
- data.tar.gz: af516c492503bc6be9ae0ec24c59868e8dcd1336
3
+ metadata.gz: 71aca8f27ca598ca51566e70d227c5972a3368e7
4
+ data.tar.gz: 1aeb6d7004041310bc076988d824978c50484c4e
5
5
  SHA512:
6
- metadata.gz: 943d942263bab545927ef19834f64ef0cf9bc7a089380316889b331d87128845d781ed989070c026fb5673b16605d36d84362929740a2b9efc598580bfcfe2fd
7
- data.tar.gz: 7f4a43760288510ea90bbee966aa906c32529455a10e507e988e5269d61ec83aeff087acaec9efe1c7d771be632b04153bdebafe131de75f33c8b65dd3def4b9
6
+ metadata.gz: 69f2bd02e62197d9f03f418a4908aa65b0825e7648352f31d29327a35d6051fb54f87f49b2eb4d00fdc59579e31a96f0fe4f6693785bf71440444b21ed1ce264
7
+ data.tar.gz: 15df6b18706e4f3061549e5b8cf23794c6b8192ab470e7fbf3f4526da5bdcd5c3761844f7a4a6e582f6176cab135d4ac7ddd042fb1b8a3e440dae7b6bad2c9d1
data/README.md CHANGED
@@ -55,7 +55,9 @@ Set capistrano variables with `set name, value`.
55
55
  Name | Default | Description
56
56
  ---- | ------- | -----------
57
57
  ask_release | false | When true, asks for the release title and text
58
- release_tag | `Time.now.strftime('release-%Y%m%d-%H%M')` | Create releases when git-tag name
58
+ release_tag | `fetch(:released_at).strftime('%Y%m%d-%H%M%S%z')` | Create releases when git-tag name
59
+ release_title | use pull-request title | Title of release note
60
+ release_body | release time and pull-request id | Body of release note
59
61
  release_comment | This change was deployed to production :octocat: ... | Pull requests to deploy report comment
60
62
 
61
63
  ### GitHub Enterprise
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Github
3
3
  module Releases
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.0'
5
5
  end
6
6
  end
7
7
  end
@@ -17,7 +17,8 @@ end
17
17
  namespace :github do
18
18
  namespace :releases do
19
19
  set :ask_release, false
20
- set :release_tag, -> { Time.now.strftime('release-%Y%m%d-%H%M') }
20
+ set :released_at, -> { Time.now }
21
+ set :release_tag, -> { fetch(:released_at).strftime('%Y%m%d-%H%M%S%z') }
21
22
 
22
23
  set :username, -> {
23
24
  username = `git config --get user.name`.strip
@@ -48,13 +49,16 @@ namespace :github do
48
49
  }
49
50
 
50
51
  set :release_body, -> {
51
- pull_req = "pull request: #{fetch(:github_repo)}##{fetch(:pull_request_id)}"
52
+ default_body = <<-MD.gsub(/^ {6}/, '').strip
53
+ released at #{fetch(:released_at).strftime('%Y-%m-%d %H:%M:%S %z')}
54
+ pull request: #{fetch(:github_repo)}##{fetch(:pull_request_id)}
55
+ MD
52
56
 
53
57
  if fetch(:ask_release)
54
- body = HighLine.new.ask("Release Comment? [default: #{pull_req}]")
55
- "#{body + "\n" unless body.empty?}#{pull_req}"
58
+ body = HighLine.new.ask("Release Body?")
59
+ "#{body + "\n" unless body.empty?}#{default_body}"
56
60
  else
57
- pull_req
61
+ default_body
58
62
  end
59
63
  }
60
64
 
@@ -128,7 +132,7 @@ namespace :github do
128
132
  draft: false,
129
133
  prerelease: false
130
134
  )
131
- info "Release of #{fetch(:release_title)} as #{fetch(:release_tag)} to #{fetch(:github_repo)} was created"
135
+ info "Release as #{fetch(:release_tag)} to #{fetch(:github_repo)} was created"
132
136
  rescue => e
133
137
  error e.message
134
138
  invoke 'github:git:create_tag_and_push_origin'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-github-releases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - linyows