github-release-party 0.4.2 → 0.4.4
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 +21 -31
- data/lib/github-release-party/tasks/heroku.rb +4 -4
- data/lib/github-release-party/version.rb +1 -1
- data/lib/github-release-party.rb +11 -3
- data.tar.gz.sig +1 -3
- 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: 664c59ae81cad40fef59088692a751f24b438191f6cbecbd03b71844a89da55f
|
|
4
|
+
data.tar.gz: 4d43e58bb67513ddaaea47bcf043bc30026c75103783e1d8e99376035cd18102
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab4e3654310e8243dabb644b40f0ed31925acba3570fd347670853000c2680648ea08e35505067aac69b82829aacd908e3317e5ce0c4aa6d6bf2115de40afc40
|
|
7
|
+
data.tar.gz: e672bad301708a093c8014926790426e1cfc27dace66220c9259651e7a4eb9273b1e10d346b1abef986585a564a922169fffc70d26d9d9a670355bf7069c3910
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -3,19 +3,18 @@ require "shellwords"
|
|
|
3
3
|
require "github-release-party"
|
|
4
4
|
|
|
5
5
|
def fly_deploy(args=[])
|
|
6
|
-
# grab the new version number from the "fly deploy" output
|
|
7
6
|
cmd = %w[fly deploy] + args
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
return system(*cmd)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def fly_releases()
|
|
11
|
+
data = `fly releases --json`
|
|
12
|
+
abort unless $?.success?
|
|
13
|
+
return JSON.parse(data)
|
|
14
|
+
rescue => err
|
|
15
|
+
puts "There was a problem getting the release number."
|
|
16
|
+
puts "The error was: #{err.message}"
|
|
17
|
+
abort
|
|
19
18
|
end
|
|
20
19
|
|
|
21
20
|
def github_tag(hash, ver)
|
|
@@ -39,10 +38,10 @@ def github_tag(hash, ver)
|
|
|
39
38
|
puts
|
|
40
39
|
puts "Tagging #{tag_name}."
|
|
41
40
|
success = system "git tag -a -m #{Shellwords.shellescape(message)} #{tag_name} #{hash}"
|
|
42
|
-
|
|
41
|
+
puts "Ignoring error." unless success
|
|
43
42
|
puts
|
|
44
43
|
success = system "git push origin #{tag_name}"
|
|
45
|
-
|
|
44
|
+
puts "Ignoring error." unless success
|
|
46
45
|
|
|
47
46
|
# create GitHub release
|
|
48
47
|
puts
|
|
@@ -55,7 +54,9 @@ end
|
|
|
55
54
|
desc "Deploy a new version to Fly"
|
|
56
55
|
task :deploy do
|
|
57
56
|
GithubReleaseParty.check_env!
|
|
58
|
-
|
|
57
|
+
fly_deploy() or abort("Deploy failed.")
|
|
58
|
+
releases = fly_releases()
|
|
59
|
+
ver = "v#{releases[0]["Version"]}"
|
|
59
60
|
hash = `git rev-parse HEAD`.strip
|
|
60
61
|
github_tag(hash, ver)
|
|
61
62
|
end
|
|
@@ -64,20 +65,9 @@ namespace :deploy do
|
|
|
64
65
|
desc "Tag last release"
|
|
65
66
|
task :tag do
|
|
66
67
|
GithubReleaseParty.check_env!
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
data = `fly releases --json`
|
|
71
|
-
abort if not $?.success?
|
|
72
|
-
fly_releases = JSON.parse(data)
|
|
73
|
-
ver = "v#{fly_releases[0]["Version"]}"
|
|
74
|
-
hash = `git rev-parse HEAD`.strip
|
|
75
|
-
rescue => err
|
|
76
|
-
puts "There was a problem getting the release number."
|
|
77
|
-
puts "The error was: #{err.message}"
|
|
78
|
-
abort
|
|
79
|
-
end
|
|
80
|
-
|
|
68
|
+
releases = fly_releases()
|
|
69
|
+
ver = "v#{releases[0]["Version"]}"
|
|
70
|
+
hash = `git rev-parse HEAD`.strip
|
|
81
71
|
github_tag(hash, ver)
|
|
82
72
|
end
|
|
83
73
|
|
|
@@ -107,9 +97,9 @@ namespace :deploy do
|
|
|
107
97
|
end
|
|
108
98
|
|
|
109
99
|
success = system "GIT_COMMITTER_DATE='#{date}' git tag -f -a -m #{Shellwords.shellescape(message)} #{tag_name} #{tag_name}^{}"
|
|
110
|
-
abort
|
|
100
|
+
abort unless success
|
|
111
101
|
success = system "git push -f origin #{tag_name}"
|
|
112
|
-
abort
|
|
102
|
+
abort unless success
|
|
113
103
|
|
|
114
104
|
# update or create GitHub release
|
|
115
105
|
release = releases.find { |rel| rel["tag_name"] == tag_name }
|
|
@@ -39,10 +39,10 @@ def github_tag(hash, ver)
|
|
|
39
39
|
puts
|
|
40
40
|
puts "Tagging #{tag_name}."
|
|
41
41
|
success = system "git tag -a -m #{Shellwords.shellescape(message)} #{tag_name} #{hash}"
|
|
42
|
-
abort
|
|
42
|
+
abort unless success
|
|
43
43
|
puts
|
|
44
44
|
success = system "git push origin #{tag_name}"
|
|
45
|
-
abort
|
|
45
|
+
abort unless success
|
|
46
46
|
|
|
47
47
|
# create GitHub release
|
|
48
48
|
puts
|
|
@@ -111,9 +111,9 @@ namespace :deploy do
|
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
success = system "GIT_COMMITTER_DATE='#{date}' git tag -f -a -m #{Shellwords.shellescape(message)} #{tag_name} #{tag_name}^{}"
|
|
114
|
-
abort
|
|
114
|
+
abort unless success
|
|
115
115
|
success = system "git push -f origin #{tag_name}"
|
|
116
|
-
abort
|
|
116
|
+
abort unless success
|
|
117
117
|
|
|
118
118
|
# update or create GitHub release
|
|
119
119
|
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
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.4
|
|
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.3
|
|
83
80
|
specification_version: 4
|
|
84
81
|
summary: Easily create GitHub releases.
|
|
85
82
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|