tworingtools 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bumpr +56 -0
- data/bin/prerelease-podspec +8 -8
- data/bin/release-podspec +19 -6
- data/bin/revert-failed-release-tag +3 -2
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6af08c45396b88d1934326b852314dbb5f82b14e2d4fab645ce20b748b73814e
|
4
|
+
data.tar.gz: 65ba5360b292fbbe41a239b7543613639ae653aafcc137bda30d6e3db1310e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd068730c8e522849dd7946cf4824b1645cd98c6ef831133e12f4ed5bd121c7dc2ca193e8b1b5fe35d2c7a8533eda71c7aaadf642af31a3704828ea458f8fbdf
|
7
|
+
data.tar.gz: 43637a632b09abbc10d249625875d72f5b787f75d0c0fa24d3c34cd6a95f96462b3558cdffa0067eb9204183a2bf7b37106724bdd2b1ddaef02aa59f031c9dae
|
data/bin/bumpr
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'open3'
|
4
|
+
require 'optparse'
|
5
|
+
require_relative '../lib/echoexec'
|
6
|
+
|
7
|
+
options = {}
|
8
|
+
parser = OptionParser.new do |opts|
|
9
|
+
opts.banner = <<~BANNER
|
10
|
+
|
11
|
+
Usage: bumpr <component> /path/to/../version.file
|
12
|
+
|
13
|
+
Component types:
|
14
|
+
|
15
|
+
- "major", "minor", "patch" semantic version components
|
16
|
+
- "build" numeric build numbers
|
17
|
+
|
18
|
+
BANNER
|
19
|
+
opts.on('-h', '--help', 'Print this help message.') do
|
20
|
+
puts opts
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
end
|
24
|
+
parser.parse!
|
25
|
+
|
26
|
+
modified_file_count, stderr, status = Open3.capture3("git status --porcelain | egrep '^(M| M)' | wc -l")
|
27
|
+
if modified_file_count.to_i > 0 then
|
28
|
+
echo_and_exec 'git stash'
|
29
|
+
end
|
30
|
+
|
31
|
+
component = ARGV[0]
|
32
|
+
version_file = ARGV[1]
|
33
|
+
|
34
|
+
# map this scripts argument values (key) to vrsnr's argument values (value)
|
35
|
+
argument = {
|
36
|
+
'major' => 'major',
|
37
|
+
'minor' => 'minor',
|
38
|
+
'patch' => 'patch',
|
39
|
+
'build' => '--numeric'
|
40
|
+
}[component]
|
41
|
+
|
42
|
+
if argument == nil then
|
43
|
+
puts 'Unrecognized version component.'
|
44
|
+
exit 1
|
45
|
+
end
|
46
|
+
|
47
|
+
command = "vrsn #{argument} --file #{version_file}"
|
48
|
+
puts command
|
49
|
+
stdout, stderr, status = Open3.capture3(command)
|
50
|
+
|
51
|
+
echo_and_exec "git add #{version_file}"
|
52
|
+
echo_and_exec "git commit --message \"#{stdout}\""
|
53
|
+
|
54
|
+
if modified_file_count.to_i > 0 then
|
55
|
+
echo_and_exec "git stash pop"
|
56
|
+
end
|
data/bin/prerelease-podspec
CHANGED
@@ -32,16 +32,16 @@ version_file = "#{podspec}.podspec"
|
|
32
32
|
|
33
33
|
current_version = `vrsn --read --file #{version_file}`.strip
|
34
34
|
branch = "#{podspec}-#{current_version}-release"
|
35
|
-
|
35
|
+
echoexec "git checkout -b #{branch}"
|
36
36
|
|
37
37
|
tag_root = "#{podspec}-#{current_version}-RC"
|
38
38
|
release_candidate_number = `git tag --list | grep #{tag_root} | wc -l`.strip.to_i + 1
|
39
39
|
release_candidate_tag = "#{tag_root}#{release_candidate_number}"
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
echoexec "sed -i '' \"s/\\(\\.version *= *'\\).*'/\\1\"#{current_version}-RC#{release_candidate_number}\"\\'/g\" #{version_file}"
|
41
|
+
echoexec "git add #{version_file}"
|
42
|
+
echoexec "git commit --message 'TEMP: set podspec version to release candidate version'"
|
43
|
+
echoexec "git tag #{release_candidate_tag}"
|
44
|
+
echoexec 'git push --tags'
|
45
45
|
|
46
46
|
puts "About to lint the podspec. This takes a while... (it is now #{Time.now})"
|
47
47
|
spec_lint_flags = Array.new
|
@@ -53,8 +53,8 @@ if options[:verbose] != nil then
|
|
53
53
|
end
|
54
54
|
stdout, stderr, status = Open3.capture3 "rbenv exec bundle exec pod spec lint #{podspec}.podspec #{spec_lint_flags.join ' '}"
|
55
55
|
|
56
|
-
|
57
|
-
|
56
|
+
echoexec 'git checkout master'
|
57
|
+
echoexec "git branch -D #{branch}"
|
58
58
|
|
59
59
|
if status != 0 then
|
60
60
|
puts "Podspec failed validation:\nstdout: #{stdout}\nstderr: #{stderr}"
|
data/bin/release-podspec
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'open3'
|
3
4
|
require 'optparse'
|
5
|
+
require_relative '../lib/echoexec'
|
4
6
|
|
5
7
|
podspec = ARGV[0]
|
6
8
|
|
@@ -17,7 +19,7 @@ parser = OptionParser.new do |opts|
|
|
17
19
|
BANNER
|
18
20
|
opts.on('-w', '--allow-warnings', 'Pass \'--allow-warnings\' to \'cocoapods spec lint\'.') do |force| options[:allow_warnings] = true end
|
19
21
|
opts.on('-v', '--verbose', 'Pass \'--verbose\' to \'cocoapods spec lint\'.') do |name| options[:verbose] = true end
|
20
|
-
opts.on('-rREPO', '--repo=REPO', 'By default, release-podspec
|
22
|
+
opts.on('-rREPO', '--repo=REPO', 'By default, release-podspec pushes the podspec to CocoaPods trunk. By supplying this argument, instead of \`pod trunk push\`, \`pod repo push\` is used instead.') do |repo| options[:repo] = repo end
|
21
23
|
opts.on('-h', '--help', 'Print this help message.') do
|
22
24
|
puts opts
|
23
25
|
exit
|
@@ -27,8 +29,11 @@ parser.parse!
|
|
27
29
|
|
28
30
|
version_file = "#{podspec}.podspec"
|
29
31
|
version = `vrsn --read --file #{version_file}`
|
30
|
-
|
31
|
-
|
32
|
+
stdout, stderr, status = Open3.capture3 "git tag #{podspec}-#{version.strip}"
|
33
|
+
if status != 0
|
34
|
+
fail 'Tag already exists.'
|
35
|
+
end
|
36
|
+
echo_and_exec 'git push --tags'
|
32
37
|
|
33
38
|
spec_lint_flags = Array.new
|
34
39
|
if options[:allow_warnings] != nil then
|
@@ -38,10 +43,18 @@ if options[:verbose] != nil then
|
|
38
43
|
spec_lint_flags << '--verbose'
|
39
44
|
end
|
40
45
|
|
41
|
-
|
46
|
+
command = String.new
|
42
47
|
if options[:repo] != nil then
|
43
|
-
|
48
|
+
command = "rbenv exec bundle exec pod repo push #{options[:repo]} #{podspec}.podspec #{spec_lint_flags.join ' '}"
|
44
49
|
else
|
45
|
-
|
50
|
+
command = "rbenv exec bundle exec pod trunk push #{podspec}.podspec #{spec_lint_flags.join ' '}"
|
46
51
|
end
|
47
52
|
|
53
|
+
puts command
|
54
|
+
stdout, stderr, status = Open3.capture3 command
|
55
|
+
|
56
|
+
unless status == 0 then
|
57
|
+
fail stderr
|
58
|
+
else
|
59
|
+
puts 'Successfully pushed spec!'
|
60
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'optparse'
|
4
|
+
require_relative '../lib/echoexec'
|
4
5
|
|
5
6
|
podspec = ARGV[0]
|
6
7
|
|
@@ -25,5 +26,5 @@ parser.parse!
|
|
25
26
|
version_file = "#{podspec}.podspec"
|
26
27
|
version = `vrsn --read --file #{version_file}`.strip
|
27
28
|
tag = "#{podspec}-#{version}"
|
28
|
-
|
29
|
-
|
29
|
+
echo_and_exec "git tag --delete #{tag}"
|
30
|
+
echo_and_exec "git push --delete origin #{tag}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tworingtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew McKnight
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github_api
|
@@ -42,6 +42,10 @@ description: |2
|
|
42
42
|
- rebuild-sims: Delete all simulators and recreate one for each compatible platform and device type pairing.
|
43
43
|
- sync-forks: Make sure all your GitHub forks are clones into a given directory, and have “upstream” remotes pointing to the repos that were forked.
|
44
44
|
- changetag: Extract changelog entries to write into git tag annotation messages.
|
45
|
+
- prerelease-podspec: Branch and create/push a release candidate tag, modify the podspec to use that version tag, and try linting it.
|
46
|
+
- release-podspec: Create a tag with the version and push it to repo origin, push podspec to CocoaPods trunk.
|
47
|
+
- revert-failed-release-tag: In case `release-podspec` fails, make sure the tag it may have created/pushed is destroyed before trying to run it again after fixing, so it doesn't break due to the tag already existing the second time around.
|
48
|
+
- bumpr: Increment the desired part of a version number (major/minor/patch/build) and write the change to a git commit.
|
45
49
|
email: andrew@tworingsoft.com
|
46
50
|
executables:
|
47
51
|
- rebuild-sims
|
@@ -50,9 +54,11 @@ executables:
|
|
50
54
|
- prerelease-podspec
|
51
55
|
- release-podspec
|
52
56
|
- revert-failed-release-tag
|
57
|
+
- bumpr
|
53
58
|
extensions: []
|
54
59
|
extra_rdoc_files: []
|
55
60
|
files:
|
61
|
+
- bin/bumpr
|
56
62
|
- bin/changetag
|
57
63
|
- bin/prerelease-podspec
|
58
64
|
- bin/rebuild-sims
|