bake-gem 0.4.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/gem/release/branch.rb +1 -1
- data/bake/gem/release/version.rb +1 -1
- data/bake/gem.rb +2 -1
- data/lib/bake/gem/helper.rb +21 -7
- data/lib/bake/gem/shell.rb +10 -5
- data/lib/bake/gem/version.rb +1 -1
- data/lib/bake/gem.rb +1 -1
- data/license.md +1 -1
- data/readme.md +14 -33
- data.tar.gz.sig +0 -0
- metadata +12 -38
- 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: 73b07dbaea11129cd0e9022c476330602dbd3aeeec3fe69064bd365d20976665
|
4
|
+
data.tar.gz: 42675a6c56c29dd54e5a103a6eee4ca5e42febf8f93783ed1633fe9cb9438db6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99578f4c9aca82a9dda42e006b261f84858a6f282f7f725849af9c566e459e5490569f701b37c5ae1f083bcb414c9b32cd06bbf876a574fa52c71f26f9d741d9
|
7
|
+
data.tar.gz: fdd496e868dbf915ee81d7f11851cb274770792e39698785c32c38990af88e21b6d7a243f5f0f1a056cca84e1a8cfbd9b49279ecb61d6e541945c353fb6da144
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/gem/release/branch.rb
CHANGED
data/bake/gem/release/version.rb
CHANGED
data/bake/gem.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require_relative '../lib/bake/gem/helper'
|
7
7
|
require_relative '../lib/bake/gem/shell'
|
@@ -44,6 +44,7 @@ end
|
|
44
44
|
|
45
45
|
def release(tag: true)
|
46
46
|
@helper.guard_clean
|
47
|
+
@helper.guard_default_branch
|
47
48
|
|
48
49
|
version = @helper.gemspec.version
|
49
50
|
|
data/lib/bake/gem/helper.rb
CHANGED
@@ -19,6 +19,7 @@ module Bake
|
|
19
19
|
@gemspec = gemspec || find_gemspec
|
20
20
|
end
|
21
21
|
|
22
|
+
attr :root
|
22
23
|
attr :gemspec
|
23
24
|
|
24
25
|
def version_path
|
@@ -27,8 +28,8 @@ module Bake
|
|
27
28
|
|
28
29
|
VERSION_PATTERN = /VERSION = ['"](?<value>\d+\.\d+\.\d+)(?<pre>.*?)['"]/
|
29
30
|
|
30
|
-
def update_version(bump)
|
31
|
-
return unless version_path
|
31
|
+
def update_version(bump, version_path = self.version_path)
|
32
|
+
return false unless version_path
|
32
33
|
|
33
34
|
lines = File.readlines(version_path)
|
34
35
|
version = nil
|
@@ -49,7 +50,9 @@ module Bake
|
|
49
50
|
end
|
50
51
|
|
51
52
|
if version
|
52
|
-
|
53
|
+
if block_given?
|
54
|
+
yield version
|
55
|
+
end
|
53
56
|
|
54
57
|
File.write(version_path, lines.join)
|
55
58
|
|
@@ -58,11 +61,24 @@ module Bake
|
|
58
61
|
end
|
59
62
|
|
60
63
|
def guard_clean
|
61
|
-
lines = readlines("git", "status", "--porcelain")
|
64
|
+
lines = readlines("git", "status", "--porcelain", chdir: @root)
|
62
65
|
|
63
66
|
if lines.any?
|
64
67
|
raise "Repository has uncommited changes!\n#{lines.join('')}"
|
65
68
|
end
|
69
|
+
|
70
|
+
return true
|
71
|
+
end
|
72
|
+
|
73
|
+
def guard_default_branch
|
74
|
+
branch = readlines("git", "branch", "--show-current", chdir: @root).first.chomp
|
75
|
+
remote_head_branch = readlines("git", "symbolic-ref", "refs/remotes/origin/HEAD", chdir: @root).first.chomp.split('/').last
|
76
|
+
|
77
|
+
if branch != remote_head_branch
|
78
|
+
raise "Current branch is not the default branch: #{branch} != #{remote_head_branch}"
|
79
|
+
end
|
80
|
+
|
81
|
+
return true
|
66
82
|
end
|
67
83
|
|
68
84
|
# @parameter root [String] The root path for package files.
|
@@ -81,7 +97,7 @@ module Bake
|
|
81
97
|
elsif signing_key == true and @gemspec.signing_key.nil?
|
82
98
|
raise ArgumentError, "Signing key is required for signing the gem, but none was specified by the gemspec."
|
83
99
|
end
|
84
|
-
|
100
|
+
|
85
101
|
::Gem::Package.build(@gemspec, false, false, output_path)
|
86
102
|
end
|
87
103
|
|
@@ -93,8 +109,6 @@ module Bake
|
|
93
109
|
system("gem", "push", path, *arguments)
|
94
110
|
end
|
95
111
|
|
96
|
-
private
|
97
|
-
|
98
112
|
def find_gemspec(glob = "*.gemspec")
|
99
113
|
paths = Dir.glob(glob, base: @root).sort
|
100
114
|
|
data/lib/bake/gem/shell.rb
CHANGED
@@ -1,35 +1,40 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021, by Samuel Williams.
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
|
+
|
6
|
+
require 'console'
|
7
|
+
require 'console/event/spawn'
|
5
8
|
|
6
9
|
module Bake
|
7
10
|
module Gem
|
8
11
|
module Shell
|
9
12
|
def system(*arguments, **options)
|
10
|
-
Console
|
13
|
+
Console::Event::Spawn.for(*arguments, **options).emit(self)
|
11
14
|
|
12
15
|
begin
|
13
16
|
pid = Process.spawn(*arguments, **options)
|
14
|
-
yield if block_given?
|
17
|
+
return yield if block_given?
|
15
18
|
ensure
|
16
19
|
pid, status = Process.wait2(pid) if pid
|
17
20
|
|
18
21
|
unless status.success?
|
19
22
|
raise "Failed to execute #{arguments}: #{status}!"
|
20
23
|
end
|
24
|
+
|
25
|
+
return true
|
21
26
|
end
|
22
27
|
end
|
23
28
|
|
24
29
|
def execute(*arguments, **options)
|
25
|
-
Console
|
30
|
+
Console::Event::Spawn.for(*arguments, **options).emit(self)
|
26
31
|
|
27
32
|
IO.pipe do |input, output|
|
28
33
|
pid = Process.spawn(*arguments, out: output, **options)
|
29
34
|
output.close
|
30
35
|
|
31
36
|
begin
|
32
|
-
yield
|
37
|
+
return yield(input)
|
33
38
|
ensure
|
34
39
|
pid, status = Process.wait2(pid)
|
35
40
|
|
data/lib/bake/gem/version.rb
CHANGED
data/lib/bake/gem.rb
CHANGED
data/license.md
CHANGED
data/readme.md
CHANGED
@@ -2,50 +2,31 @@
|
|
2
2
|
|
3
3
|
Provides bake tasks for common gem release workflows.
|
4
4
|
|
5
|
-
[![
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
``` shell
|
10
|
-
$ bundle add bake-gem
|
11
|
-
```
|
5
|
+
[![Development Status](https://github.com/ioquatix/bake-gem/workflows/Test/badge.svg)](https://github.com/ioquatix/bake-gem/actions?workflow=Test)
|
12
6
|
|
13
7
|
## Usage
|
14
8
|
|
15
|
-
|
16
|
-
|
17
|
-
Releasing a gem locally is the most typical process.
|
18
|
-
|
19
|
-
``` shell
|
20
|
-
$ bake gem:release:version:(major|minor|patch) gem:release
|
21
|
-
```
|
9
|
+
Please see the [project documentation](https://ioquatix.github.io/bake-gem/) for more details.
|
22
10
|
|
23
|
-
|
11
|
+
- [Getting Started](https://ioquatix.github.io/bake-gem/guides/getting-started/index) - This guide explains how to use `bake-gem` to release gems.
|
24
12
|
|
25
|
-
|
26
|
-
|
27
|
-
Releasing a gem via a automated pipeline is also supported. Locally, create a release branch:
|
13
|
+
## Contributing
|
28
14
|
|
29
|
-
|
30
|
-
$ bake gem:release:branch:(major|minor|patch)
|
31
|
-
```
|
15
|
+
We welcome contributions to this project.
|
32
16
|
|
33
|
-
|
17
|
+
1. Fork it.
|
18
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
19
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
20
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
21
|
+
5. Create new Pull Request.
|
34
22
|
|
35
|
-
|
36
|
-
$ export RUBYGEMS_HOST=...
|
37
|
-
$ export GEM_HOST_API_KEY=...
|
23
|
+
### Developer Certificate of Origin
|
38
24
|
|
39
|
-
|
40
|
-
```
|
25
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
41
26
|
|
42
|
-
|
27
|
+
### Contributor Covenant
|
43
28
|
|
44
|
-
|
45
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
46
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
47
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
48
|
-
5. Create new Pull Request
|
29
|
+
This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
49
30
|
|
50
31
|
## See Also
|
51
32
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,50 +37,22 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date:
|
40
|
+
date: 2024-06-10 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: console
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
49
|
-
type: :
|
48
|
+
version: '1.25'
|
49
|
+
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - "
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: covered
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rspec
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
55
|
+
version: '1.25'
|
84
56
|
description:
|
85
57
|
email:
|
86
58
|
executables: []
|
@@ -100,7 +72,9 @@ homepage: https://github.com/ioquatix/bake-gem
|
|
100
72
|
licenses:
|
101
73
|
- MIT
|
102
74
|
metadata:
|
75
|
+
documentation_uri: https://ioquatix.github.io/bake-gem/
|
103
76
|
funding_uri: https://github.com/sponsors/ioquatix/
|
77
|
+
source_code_uri: https://github.com/ioquatix/bake-gem.git
|
104
78
|
post_install_message:
|
105
79
|
rdoc_options: []
|
106
80
|
require_paths:
|
@@ -109,14 +83,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
83
|
requirements:
|
110
84
|
- - ">="
|
111
85
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
86
|
+
version: '3.1'
|
113
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
88
|
requirements:
|
115
89
|
- - ">="
|
116
90
|
- !ruby/object:Gem::Version
|
117
91
|
version: '0'
|
118
92
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
93
|
+
rubygems_version: 3.5.9
|
120
94
|
signing_key:
|
121
95
|
specification_version: 4
|
122
96
|
summary: Release management for Ruby gems.
|
metadata.gz.sig
CHANGED
Binary file
|