github-release-party 0.4.3 → 0.4.5
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/github-release-party/tasks/fly.rb +8 -7
- data/lib/github-release-party/tasks/heroku.rb +9 -8
- data/lib/github-release-party/version.rb +1 -1
- data/lib/github-release-party.rb +11 -3
- data.tar.gz.sig +0 -0
- metadata +3 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8cd5a7e2c3daa955db7628605058c697a2cf1bc045b52640e0a3328d25261183
|
|
4
|
+
data.tar.gz: 2da10dda6892979d9b3b2e9ae8af94ef598be709e0a69eaf59fd4d1d47b454e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f179fcae86adc5a9489dd0ecd7fc63c5f53473c9633685572f695733a8814cfbb9278c7f279b2735e98c6342c48168ddaae7422dfc3abbbf49bfcd432ae1a9d
|
|
7
|
+
data.tar.gz: b4a4cda938e8458600e631acfd85e0ddd4d9819f72db0eea60ea93bd74b0203381de8a5a85247c58148e4e21bdeabfcfe686d5c854c17dd2cf183e077a14e7db
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -4,12 +4,13 @@ require "github-release-party"
|
|
|
4
4
|
|
|
5
5
|
def fly_deploy(args=[])
|
|
6
6
|
cmd = %w[fly deploy] + args
|
|
7
|
+
puts "Executing: #{cmd.join(" ")}"
|
|
7
8
|
return system(*cmd)
|
|
8
9
|
end
|
|
9
10
|
|
|
10
11
|
def fly_releases()
|
|
11
12
|
data = `fly releases --json`
|
|
12
|
-
abort
|
|
13
|
+
abort unless $?.success?
|
|
13
14
|
return JSON.parse(data)
|
|
14
15
|
rescue => err
|
|
15
16
|
puts "There was a problem getting the release number."
|
|
@@ -38,10 +39,10 @@ def github_tag(hash, ver)
|
|
|
38
39
|
puts
|
|
39
40
|
puts "Tagging #{tag_name}."
|
|
40
41
|
success = system "git tag -a -m #{Shellwords.shellescape(message)} #{tag_name} #{hash}"
|
|
41
|
-
|
|
42
|
+
puts "Ignoring error." unless success
|
|
42
43
|
puts
|
|
43
44
|
success = system "git push origin #{tag_name}"
|
|
44
|
-
|
|
45
|
+
puts "Ignoring error." unless success
|
|
45
46
|
|
|
46
47
|
# create GitHub release
|
|
47
48
|
puts
|
|
@@ -52,9 +53,9 @@ end
|
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
desc "Deploy a new version to Fly"
|
|
55
|
-
task :deploy do
|
|
56
|
+
task :deploy do |task, args|
|
|
56
57
|
GithubReleaseParty.check_env!
|
|
57
|
-
fly_deploy() or abort("Deploy failed.")
|
|
58
|
+
fly_deploy(args.to_a) or abort("Deploy failed.")
|
|
58
59
|
releases = fly_releases()
|
|
59
60
|
ver = "v#{releases[0]["Version"]}"
|
|
60
61
|
hash = `git rev-parse HEAD`.strip
|
|
@@ -97,9 +98,9 @@ namespace :deploy do
|
|
|
97
98
|
end
|
|
98
99
|
|
|
99
100
|
success = system "GIT_COMMITTER_DATE='#{date}' git tag -f -a -m #{Shellwords.shellescape(message)} #{tag_name} #{tag_name}^{}"
|
|
100
|
-
abort
|
|
101
|
+
abort unless success
|
|
101
102
|
success = system "git push -f origin #{tag_name}"
|
|
102
|
-
abort
|
|
103
|
+
abort unless success
|
|
103
104
|
|
|
104
105
|
# update or create GitHub release
|
|
105
106
|
release = releases.find { |rel| rel["tag_name"] == tag_name }
|
|
@@ -5,6 +5,7 @@ require "github-release-party"
|
|
|
5
5
|
def heroku_push(args=[])
|
|
6
6
|
# grab the new version number from the Heroku push output
|
|
7
7
|
cmd = %w[git push heroku HEAD:master] + args
|
|
8
|
+
puts "Executing: #{cmd.join(" ")}"
|
|
8
9
|
ver = Open3.popen2e(*cmd) do |stdin, output, thread|
|
|
9
10
|
v = nil
|
|
10
11
|
output.each do |line|
|
|
@@ -39,10 +40,10 @@ def github_tag(hash, ver)
|
|
|
39
40
|
puts
|
|
40
41
|
puts "Tagging #{tag_name}."
|
|
41
42
|
success = system "git tag -a -m #{Shellwords.shellescape(message)} #{tag_name} #{hash}"
|
|
42
|
-
abort
|
|
43
|
+
abort unless success
|
|
43
44
|
puts
|
|
44
45
|
success = system "git push origin #{tag_name}"
|
|
45
|
-
abort
|
|
46
|
+
abort unless success
|
|
46
47
|
|
|
47
48
|
# create GitHub release
|
|
48
49
|
puts
|
|
@@ -53,18 +54,18 @@ end
|
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
desc "Deploy a new version to Heroku"
|
|
56
|
-
task :deploy do
|
|
57
|
+
task :deploy do |task, args|
|
|
57
58
|
GithubReleaseParty.check_env!
|
|
58
|
-
ver = heroku_push() or abort("Deploy failed.")
|
|
59
|
+
ver = heroku_push(args.to_a) or abort("Deploy failed.")
|
|
59
60
|
hash = `git rev-parse HEAD`.strip
|
|
60
61
|
github_tag(hash, ver)
|
|
61
62
|
end
|
|
62
63
|
|
|
63
64
|
namespace :deploy do
|
|
64
65
|
desc "Deploy a new version to Heroku using --force"
|
|
65
|
-
task :force do
|
|
66
|
+
task :force do |task, args|
|
|
66
67
|
GithubReleaseParty.check_env!
|
|
67
|
-
ver = heroku_push(%w[--force]) or abort("Deploy failed.")
|
|
68
|
+
ver = heroku_push(%w[--force] + args.to_a) or abort("Deploy failed.")
|
|
68
69
|
hash = `git rev-parse HEAD`.strip
|
|
69
70
|
github_tag(hash, ver)
|
|
70
71
|
end
|
|
@@ -111,9 +112,9 @@ namespace :deploy do
|
|
|
111
112
|
end
|
|
112
113
|
|
|
113
114
|
success = system "GIT_COMMITTER_DATE='#{date}' git tag -f -a -m #{Shellwords.shellescape(message)} #{tag_name} #{tag_name}^{}"
|
|
114
|
-
abort
|
|
115
|
+
abort unless success
|
|
115
116
|
success = system "git push -f origin #{tag_name}"
|
|
116
|
-
abort
|
|
117
|
+
abort unless success
|
|
117
118
|
|
|
118
119
|
# update or create GitHub release
|
|
119
120
|
release = releases.find { |rel| rel["tag_name"] == tag_name }
|
data/lib/github-release-party.rb
CHANGED
|
@@ -8,7 +8,7 @@ class GithubReleaseParty
|
|
|
8
8
|
page = 1
|
|
9
9
|
while true
|
|
10
10
|
r = GitHub.get("/repos/#{repo}/releases?page=#{page}")
|
|
11
|
-
|
|
11
|
+
unless r.success?
|
|
12
12
|
puts "Error occurred when fetching releases:"
|
|
13
13
|
puts error(r)
|
|
14
14
|
abort
|
|
@@ -58,12 +58,20 @@ class GithubReleaseParty
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def self.check_env!
|
|
61
|
-
|
|
61
|
+
unless ENV["GITHUB_RELEASE_TOKEN"]
|
|
62
62
|
abort "Configure GITHUB_RELEASE_TOKEN to create GitHub releases. See https://github.com/stefansundin/github-release-party#setup"
|
|
63
63
|
end
|
|
64
|
-
|
|
64
|
+
unless repo
|
|
65
65
|
abort "Can't find the GitHub repository. Please use the remote 'origin'."
|
|
66
66
|
end
|
|
67
|
+
r = GitHub.get("/user")
|
|
68
|
+
if r.success?
|
|
69
|
+
puts "Creating GitHub release with user #{r.json["login"]}."
|
|
70
|
+
else
|
|
71
|
+
puts "Error authenticating with GitHub. Your token may have expired."
|
|
72
|
+
puts r.body
|
|
73
|
+
abort
|
|
74
|
+
end
|
|
67
75
|
end
|
|
68
76
|
|
|
69
77
|
def self.repo
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: github-release-party
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Sundin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain:
|
|
11
10
|
- |
|
|
@@ -31,7 +30,7 @@ cert_chain:
|
|
|
31
30
|
E04BZKo2WzOTzSDymo97Yu4YFgyc98umMyeaCvPk4YmdNzqSanAXpY2bnsyu0CF5
|
|
32
31
|
Td0=
|
|
33
32
|
-----END CERTIFICATE-----
|
|
34
|
-
date:
|
|
33
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
35
34
|
dependencies:
|
|
36
35
|
- !ruby/object:Gem::Dependency
|
|
37
36
|
name: rake
|
|
@@ -63,7 +62,6 @@ homepage: https://github.com/stefansundin/github-release-party
|
|
|
63
62
|
licenses:
|
|
64
63
|
- GPL-3.0
|
|
65
64
|
metadata: {}
|
|
66
|
-
post_install_message:
|
|
67
65
|
rdoc_options: []
|
|
68
66
|
require_paths:
|
|
69
67
|
- lib
|
|
@@ -78,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
78
76
|
- !ruby/object:Gem::Version
|
|
79
77
|
version: 1.3.6
|
|
80
78
|
requirements: []
|
|
81
|
-
rubygems_version:
|
|
82
|
-
signing_key:
|
|
79
|
+
rubygems_version: 4.0.15
|
|
83
80
|
specification_version: 4
|
|
84
81
|
summary: Easily create GitHub releases.
|
|
85
82
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|