rake_circle_ci 0.14.0.pre.2 → 0.14.0.pre.2.pr202.1.1
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
- data/Gemfile +1 -1
- data/Gemfile.lock +84 -70
- data/README.md +4 -4
- data/Rakefile +110 -45
- data/lib/rake_circle_ci/version.rb +1 -1
- data/rake_circle_ci.gemspec +2 -2
- metadata +17 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5609d62de04b6738790afa68fac65b445119fc5285316d883473f30964aa10b2
|
|
4
|
+
data.tar.gz: 6315b34373b22a8ad2696e3a46e49d67895c639958a7a38272f9e312fb8e7eea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c96694eb47413e825978e83f39c3dfad3b43409b31d0eb4bac5764d98968b3fa65dc7e0afb73c35179a6df044e0b72622edd79c941e81eb3e697588c5a24852f
|
|
7
|
+
data.tar.gz: df264fae9060f406b973d4016b4a3ce6c46e30e3d9e2a1c3c5dc8d1bfb84e4aa1c5e7847ea92694decfeaa25b96a92d1bb374df599f119aa470b43a797618a7a
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,77 +1,84 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rake_circle_ci (0.14.0.pre.2)
|
|
4
|
+
rake_circle_ci (0.14.0.pre.2.pr202.1.1)
|
|
5
5
|
colored2 (~> 3.1)
|
|
6
|
-
excon (
|
|
6
|
+
excon (>= 0.72, < 2.0)
|
|
7
7
|
rake_factory (~> 0.33)
|
|
8
8
|
sshkey (~> 2.0)
|
|
9
9
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
activesupport (
|
|
13
|
+
activesupport (8.1.3)
|
|
14
14
|
base64
|
|
15
15
|
bigdecimal
|
|
16
|
-
concurrent-ruby (~> 1.0, >= 1.
|
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
17
17
|
connection_pool (>= 2.2.5)
|
|
18
18
|
drb
|
|
19
19
|
i18n (>= 1.6, < 2)
|
|
20
|
+
json
|
|
21
|
+
logger (>= 1.4.2)
|
|
20
22
|
minitest (>= 5.1)
|
|
21
|
-
|
|
22
|
-
tzinfo (~> 2.0)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
securerandom (>= 0.3)
|
|
24
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
25
|
+
uri (>= 0.13.1)
|
|
26
|
+
addressable (2.9.0)
|
|
27
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
28
|
+
ast (2.4.3)
|
|
29
|
+
base64 (0.3.0)
|
|
30
|
+
bigdecimal (4.1.2)
|
|
28
31
|
childprocess (5.0.0)
|
|
29
32
|
colored2 (3.1.2)
|
|
30
|
-
concurrent-ruby (1.3.
|
|
31
|
-
connection_pool (
|
|
32
|
-
diff-lcs (1.
|
|
33
|
+
concurrent-ruby (1.3.8)
|
|
34
|
+
connection_pool (3.0.2)
|
|
35
|
+
diff-lcs (1.6.2)
|
|
33
36
|
docile (1.4.0)
|
|
34
|
-
drb (2.2.
|
|
35
|
-
excon (
|
|
36
|
-
faraday (2.10.0)
|
|
37
|
-
faraday-net_http (>= 2.0, < 3.2)
|
|
37
|
+
drb (2.2.3)
|
|
38
|
+
excon (1.2.7)
|
|
38
39
|
logger
|
|
39
|
-
faraday
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
faraday (2.14.3)
|
|
41
|
+
faraday-net_http (>= 2.0, < 3.5)
|
|
42
|
+
json
|
|
43
|
+
logger
|
|
44
|
+
faraday-net_http (3.4.4)
|
|
45
|
+
net-http (~> 0.5)
|
|
46
|
+
ffi (1.17.4)
|
|
47
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
48
|
+
gem-release (2.2.4)
|
|
42
49
|
git (1.19.1)
|
|
43
50
|
addressable (~> 2.8)
|
|
44
51
|
rchardet (~> 1.8)
|
|
45
52
|
hamster (3.0.0)
|
|
46
53
|
concurrent-ruby (~> 1.0)
|
|
47
|
-
i18n (1.
|
|
54
|
+
i18n (1.15.2)
|
|
48
55
|
concurrent-ruby (~> 1.0)
|
|
49
|
-
immutable-struct (2.
|
|
50
|
-
json (2.
|
|
51
|
-
language_server-protocol (3.17.0.
|
|
56
|
+
immutable-struct (2.5.0)
|
|
57
|
+
json (2.12.2)
|
|
58
|
+
language_server-protocol (3.17.0.5)
|
|
52
59
|
lino (4.1.0)
|
|
53
60
|
childprocess (~> 5.0.0)
|
|
54
61
|
hamster (~> 3.0)
|
|
55
62
|
open4 (~> 1.3)
|
|
56
|
-
|
|
63
|
+
lint_roller (1.1.0)
|
|
64
|
+
logger (1.7.0)
|
|
57
65
|
memfs (1.0.0)
|
|
58
|
-
minitest (5.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
octokit (8.1.0)
|
|
63
|
-
base64
|
|
66
|
+
minitest (5.27.0)
|
|
67
|
+
net-http (0.9.1)
|
|
68
|
+
uri (>= 0.11.1)
|
|
69
|
+
octokit (10.0.0)
|
|
64
70
|
faraday (>= 1, < 3)
|
|
65
71
|
sawyer (~> 0.9)
|
|
66
72
|
open4 (1.3.4)
|
|
67
|
-
parallel (1.
|
|
68
|
-
parser (3.3.
|
|
73
|
+
parallel (1.27.0)
|
|
74
|
+
parser (3.3.8.0)
|
|
69
75
|
ast (~> 2.4.1)
|
|
70
76
|
racc
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
prism (1.4.0)
|
|
78
|
+
public_suffix (7.0.5)
|
|
79
|
+
racc (1.8.1)
|
|
73
80
|
rainbow (3.1.1)
|
|
74
|
-
rake (13.2
|
|
81
|
+
rake (13.4.2)
|
|
75
82
|
rake_factory (0.33.0)
|
|
76
83
|
activesupport (>= 4)
|
|
77
84
|
rake (~> 13.0)
|
|
@@ -79,66 +86,71 @@ GEM
|
|
|
79
86
|
colored2 (~> 3.1)
|
|
80
87
|
git (~> 1.13, >= 1.13.2)
|
|
81
88
|
rake_factory (~> 0.33)
|
|
82
|
-
rake_git_crypt (0.
|
|
89
|
+
rake_git_crypt (0.4.0)
|
|
83
90
|
colored2 (~> 3.1)
|
|
91
|
+
lino (~> 4.1)
|
|
84
92
|
rake_factory (~> 0.33)
|
|
85
93
|
ruby_git_crypt (~> 0.1)
|
|
86
94
|
ruby_gpg2 (~> 0.12)
|
|
87
|
-
rake_github (0.
|
|
95
|
+
rake_github (0.17.0)
|
|
88
96
|
colored2 (~> 3.1)
|
|
89
|
-
octokit (>=
|
|
90
|
-
rake_factory (~> 0.
|
|
97
|
+
octokit (>= 7.0, < 11.0)
|
|
98
|
+
rake_factory (~> 0.33)
|
|
99
|
+
rbnacl (~> 7.1)
|
|
91
100
|
sshkey (~> 2.0)
|
|
92
101
|
rake_gpg (0.20.0)
|
|
93
102
|
rake_factory (~> 0.33)
|
|
94
103
|
ruby_gpg2 (~> 0.12)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
rake_factory (~> 0.
|
|
98
|
-
|
|
104
|
+
rake_slack (0.3.0)
|
|
105
|
+
excon (>= 0.72, < 2.0)
|
|
106
|
+
rake_factory (~> 0.33)
|
|
107
|
+
rbnacl (7.1.2)
|
|
108
|
+
ffi (~> 1)
|
|
99
109
|
rchardet (1.8.0)
|
|
100
|
-
regexp_parser (2.
|
|
101
|
-
|
|
102
|
-
strscan
|
|
103
|
-
rspec (3.13.0)
|
|
110
|
+
regexp_parser (2.10.0)
|
|
111
|
+
rspec (3.13.1)
|
|
104
112
|
rspec-core (~> 3.13.0)
|
|
105
113
|
rspec-expectations (~> 3.13.0)
|
|
106
114
|
rspec-mocks (~> 3.13.0)
|
|
107
|
-
rspec-core (3.13.
|
|
115
|
+
rspec-core (3.13.4)
|
|
108
116
|
rspec-support (~> 3.13.0)
|
|
109
|
-
rspec-expectations (3.13.
|
|
117
|
+
rspec-expectations (3.13.5)
|
|
110
118
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
111
119
|
rspec-support (~> 3.13.0)
|
|
112
|
-
rspec-mocks (3.13.
|
|
120
|
+
rspec-mocks (3.13.5)
|
|
113
121
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
114
122
|
rspec-support (~> 3.13.0)
|
|
115
|
-
rspec-support (3.13.
|
|
116
|
-
rubocop (1.
|
|
123
|
+
rspec-support (3.13.4)
|
|
124
|
+
rubocop (1.75.8)
|
|
117
125
|
json (~> 2.3)
|
|
118
|
-
language_server-protocol (
|
|
126
|
+
language_server-protocol (~> 3.17.0.2)
|
|
127
|
+
lint_roller (~> 1.1.0)
|
|
119
128
|
parallel (~> 1.10)
|
|
120
129
|
parser (>= 3.3.0.2)
|
|
121
130
|
rainbow (>= 2.2.2, < 4.0)
|
|
122
|
-
regexp_parser (>= 2.
|
|
123
|
-
|
|
124
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
|
131
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
132
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
125
133
|
ruby-progressbar (~> 1.7)
|
|
126
|
-
unicode-display_width (>= 2.4.0, <
|
|
127
|
-
rubocop-ast (1.
|
|
128
|
-
parser (>= 3.3.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
rubocop (
|
|
134
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
135
|
+
rubocop-ast (1.44.1)
|
|
136
|
+
parser (>= 3.3.7.2)
|
|
137
|
+
prism (~> 1.4)
|
|
138
|
+
rubocop-rake (0.7.1)
|
|
139
|
+
lint_roller (~> 1.1)
|
|
140
|
+
rubocop (>= 1.72.1)
|
|
141
|
+
rubocop-rspec (3.6.0)
|
|
142
|
+
lint_roller (~> 1.1)
|
|
143
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
133
144
|
ruby-progressbar (1.13.0)
|
|
134
145
|
ruby_git_crypt (0.1.0)
|
|
135
146
|
immutable-struct (~> 2.4)
|
|
136
147
|
lino (>= 4.1)
|
|
137
148
|
ruby_gpg2 (0.12.0)
|
|
138
149
|
lino (>= 4.1)
|
|
139
|
-
sawyer (0.9.
|
|
150
|
+
sawyer (0.9.3)
|
|
140
151
|
addressable (>= 2.3.5)
|
|
141
152
|
faraday (>= 0.17.3, < 3)
|
|
153
|
+
securerandom (0.4.1)
|
|
142
154
|
simplecov (0.22.0)
|
|
143
155
|
docile (~> 1.1)
|
|
144
156
|
simplecov-html (~> 0.11)
|
|
@@ -146,14 +158,16 @@ GEM
|
|
|
146
158
|
simplecov-html (0.12.3)
|
|
147
159
|
simplecov_json_formatter (0.1.4)
|
|
148
160
|
sshkey (2.0.0)
|
|
149
|
-
strscan (3.1.0)
|
|
150
161
|
tzinfo (2.0.6)
|
|
151
162
|
concurrent-ruby (~> 1.0)
|
|
152
|
-
unicode-display_width (
|
|
153
|
-
|
|
163
|
+
unicode-display_width (3.1.4)
|
|
164
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
165
|
+
unicode-emoji (4.0.4)
|
|
166
|
+
uri (1.1.1)
|
|
154
167
|
|
|
155
168
|
PLATFORMS
|
|
156
169
|
ruby
|
|
170
|
+
x86_64-linux
|
|
157
171
|
|
|
158
172
|
DEPENDENCIES
|
|
159
173
|
activesupport
|
|
@@ -166,7 +180,7 @@ DEPENDENCIES
|
|
|
166
180
|
rake_git_crypt
|
|
167
181
|
rake_github
|
|
168
182
|
rake_gpg
|
|
169
|
-
|
|
183
|
+
rake_slack
|
|
170
184
|
rspec
|
|
171
185
|
rubocop
|
|
172
186
|
rubocop-rake
|
data/README.md
CHANGED
|
@@ -34,16 +34,16 @@ release a new version, update the version number in `version.rb`, and then run
|
|
|
34
34
|
git commits and tags, and push the `.gem` file to
|
|
35
35
|
[rubygems.org](https://rubygems.org).
|
|
36
36
|
|
|
37
|
-
### Managing
|
|
37
|
+
### Managing CI keys
|
|
38
38
|
|
|
39
|
-
To encrypt a GPG key for use by
|
|
39
|
+
To encrypt a GPG key for use by CI:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
openssl aes-256-cbc \
|
|
43
43
|
-e \
|
|
44
44
|
-md sha1 \
|
|
45
45
|
-in ./config/secrets/ci/gpg.private \
|
|
46
|
-
-out ./.
|
|
46
|
+
-out ./.github/gpg.private.enc \
|
|
47
47
|
-k "<passphrase>"
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -53,7 +53,7 @@ To check decryption is working correctly:
|
|
|
53
53
|
openssl aes-256-cbc \
|
|
54
54
|
-d \
|
|
55
55
|
-md sha1 \
|
|
56
|
-
-in ./.
|
|
56
|
+
-in ./.github/gpg.private.enc \
|
|
57
57
|
-k "<passphrase>"
|
|
58
58
|
```
|
|
59
59
|
|
data/Rakefile
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'rake_circle_ci'
|
|
4
3
|
require 'rake_git'
|
|
5
4
|
require 'rake_git_crypt'
|
|
6
5
|
require 'rake_github'
|
|
7
6
|
require 'rake_gpg'
|
|
8
|
-
require '
|
|
7
|
+
require 'rake_slack'
|
|
9
8
|
require 'rspec/core/rake_task'
|
|
10
9
|
require 'rubocop/rake_task'
|
|
11
10
|
require 'securerandom'
|
|
12
|
-
require 'yaml'
|
|
13
11
|
|
|
14
12
|
task default: %i[
|
|
15
13
|
library:fix
|
|
@@ -59,13 +57,6 @@ namespace :encryption do
|
|
|
59
57
|
end
|
|
60
58
|
|
|
61
59
|
namespace :keys do
|
|
62
|
-
namespace :deploy do
|
|
63
|
-
RakeSSH.define_key_tasks(
|
|
64
|
-
path: 'config/secrets/ci/',
|
|
65
|
-
comment: 'maintainers@infrablocks.io'
|
|
66
|
-
)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
60
|
namespace :gpg do
|
|
70
61
|
RakeGPG.define_generate_key_task(
|
|
71
62
|
output_directory: 'config/secrets/ci',
|
|
@@ -107,7 +98,6 @@ namespace :secrets do
|
|
|
107
98
|
desc 'Generate all generatable secrets.'
|
|
108
99
|
task generate: %w[
|
|
109
100
|
encryption:passphrase:generate
|
|
110
|
-
keys:deploy:generate
|
|
111
101
|
keys:gpg:generate
|
|
112
102
|
]
|
|
113
103
|
|
|
@@ -131,57 +121,100 @@ namespace :library do
|
|
|
131
121
|
|
|
132
122
|
desc 'Attempt to automatically fix issues with the library'
|
|
133
123
|
task fix: [:'rubocop:autocorrect_all']
|
|
124
|
+
|
|
125
|
+
desc 'Build the library'
|
|
126
|
+
task :build do
|
|
127
|
+
sh 'gem build rake_circle_ci.gemspec'
|
|
128
|
+
end
|
|
134
129
|
end
|
|
135
130
|
|
|
136
131
|
namespace :test do
|
|
137
132
|
RSpec::Core::RakeTask.new(:unit)
|
|
138
133
|
end
|
|
139
134
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
135
|
+
namespace :slack do
|
|
136
|
+
RakeSlack.define_notification_tasks do |t|
|
|
137
|
+
t.bot_token = ENV.fetch('SLACK_BOT_TOKEN', nil)
|
|
138
|
+
t.routing_rules = [
|
|
139
|
+
{ when: { type: 'on_hold' },
|
|
140
|
+
channel: 'C038EDCRSQJ', format: :on_hold }, # release
|
|
141
|
+
{ when: { actor: 'dependabot[bot]', outcome: 'success' },
|
|
142
|
+
channel: 'C03N711HVDG', format: :success }, # builds-dependabot
|
|
143
|
+
{ when: { actor: 'dependabot[bot]' },
|
|
144
|
+
channel: 'C03N711HVDG', format: :failure }, # builds-dependabot
|
|
145
|
+
{ when: { outcome: 'success' },
|
|
146
|
+
channel: 'C023XUE76GH', format: :success }, # builds
|
|
147
|
+
# Failures go to builds, not team-dev (org default), to keep noise
|
|
148
|
+
# out of a popular channel while this pipeline beds in.
|
|
149
|
+
{ when: {},
|
|
150
|
+
channel: 'C023XUE76GH', format: :failure } # builds
|
|
151
|
+
]
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
namespace :repository do
|
|
156
|
+
desc 'Set the git author for CI'
|
|
157
|
+
task :set_ci_author do
|
|
158
|
+
sh 'git config --global user.name "InfraBlocks CI"'
|
|
159
|
+
sh 'git config --global user.email "ci@infrablocks.io"'
|
|
160
|
+
end
|
|
160
161
|
end
|
|
161
162
|
|
|
163
|
+
# rubocop:disable Metrics/BlockLength
|
|
162
164
|
RakeGithub.define_repository_tasks(
|
|
163
165
|
namespace: :github,
|
|
164
166
|
repository: 'infrablocks/rake_circle_ci'
|
|
165
167
|
) do |t|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
# Operator's ambient auth. Resolve once and fail fast: a missing,
|
|
169
|
+
# unauthenticated, or absent gh yields an empty string, which would
|
|
170
|
+
# otherwise surface later as an opaque Octokit 401. An empty or
|
|
171
|
+
# whitespace-only GITHUB_TOKEN is treated as absent so an authenticated
|
|
172
|
+
# operator falls through to `gh auth token` rather than hitting the raise.
|
|
173
|
+
github_token = ENV['GITHUB_TOKEN'].to_s.strip
|
|
174
|
+
if github_token.empty?
|
|
175
|
+
github_token = begin
|
|
176
|
+
`gh auth token`
|
|
177
|
+
rescue Errno::ENOENT
|
|
178
|
+
''
|
|
179
|
+
end.strip
|
|
180
|
+
end
|
|
181
|
+
if github_token.empty?
|
|
182
|
+
raise 'No GitHub token available: set GITHUB_TOKEN or run `gh auth login`'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
t.access_token = github_token
|
|
186
|
+
|
|
187
|
+
# Actions store only: dependabot runs never reach the passphrase — the
|
|
188
|
+
# only pr.yaml job that unlocks git-crypt (prerelease) is guarded to
|
|
189
|
+
# same-repo human PRs. Guard against a locked clone: without
|
|
190
|
+
# it, File.read returns git-crypt ciphertext and github:secrets:ensure
|
|
191
|
+
# silently uploads garbage that only surfaces much later as an opaque
|
|
192
|
+
# GPG unlock failure in the release job.
|
|
193
|
+
passphrase_path = 'config/secrets/ci/encryption.passphrase'
|
|
194
|
+
unless File.exist?(passphrase_path)
|
|
195
|
+
raise "Passphrase file not found: #{passphrase_path} — expected a " \
|
|
196
|
+
'git-crypt-unlocked clone with the CI secrets present'
|
|
197
|
+
end
|
|
198
|
+
passphrase = File.binread(passphrase_path)
|
|
199
|
+
if passphrase.start_with?("\x00GITCRYPT")
|
|
200
|
+
raise 'encryption.passphrase is git-crypt ciphertext — unlock the ' \
|
|
201
|
+
'clone before provisioning'
|
|
202
|
+
end
|
|
203
|
+
t.secrets = [
|
|
204
|
+
{ name: 'ENCRYPTION_PASSPHRASE', value: passphrase.chomp }
|
|
205
|
+
]
|
|
206
|
+
t.environments = [
|
|
207
|
+
{ name: 'release',
|
|
208
|
+
reviewers: [{ team: 'maintainers' }] }
|
|
175
209
|
]
|
|
176
210
|
end
|
|
211
|
+
# rubocop:enable Metrics/BlockLength
|
|
177
212
|
|
|
178
213
|
namespace :pipeline do
|
|
179
|
-
desc 'Prepare
|
|
214
|
+
desc 'Prepare GitHub Actions pipeline'
|
|
180
215
|
task prepare: %i[
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
circle_ci:ssh_keys:ensure
|
|
184
|
-
github:deploy_keys:ensure
|
|
216
|
+
github:secrets:ensure
|
|
217
|
+
github:environments:ensure
|
|
185
218
|
]
|
|
186
219
|
end
|
|
187
220
|
|
|
@@ -192,6 +225,38 @@ namespace :version do
|
|
|
192
225
|
end
|
|
193
226
|
end
|
|
194
227
|
|
|
228
|
+
namespace :prerelease do
|
|
229
|
+
desc 'Build and push a namespaced pre-release to RubyGems ' \
|
|
230
|
+
'(PR CI only; no bump, no tag, no commit, no push)'
|
|
231
|
+
task :publish, %i[pr_number run_number run_attempt] do |_, args|
|
|
232
|
+
%i[pr_number run_number run_attempt].each do |name|
|
|
233
|
+
raise "Missing task argument: #{name}" if args[name].to_s.empty?
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
version_file = 'lib/rake_circle_ci/version.rb'
|
|
237
|
+
version_pattern = /(VERSION\s*=\s*')([^']+)(')/
|
|
238
|
+
source = File.read(version_file)
|
|
239
|
+
base = source[version_pattern, 2]
|
|
240
|
+
raise "Could not read VERSION from #{version_file}" unless base
|
|
241
|
+
|
|
242
|
+
version = "#{base}.pr#{args.pr_number}" \
|
|
243
|
+
".#{args.run_number}.#{args.run_attempt}"
|
|
244
|
+
gem_file = "rake_circle_ci-#{version}.gem"
|
|
245
|
+
begin
|
|
246
|
+
File.write(version_file,
|
|
247
|
+
source.sub(version_pattern, "\\1#{version}\\3"))
|
|
248
|
+
# Build + push directly: `gem release` aborts on the (deliberately)
|
|
249
|
+
# uncommitted version rewrite. PR CI must not tag, commit, or push
|
|
250
|
+
# (contrast the `release` task).
|
|
251
|
+
sh 'gem build rake_circle_ci.gemspec'
|
|
252
|
+
sh "gem push #{gem_file}"
|
|
253
|
+
ensure
|
|
254
|
+
File.write(version_file, source)
|
|
255
|
+
rm_f gem_file
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
195
260
|
desc 'Release gem'
|
|
196
261
|
task :release do
|
|
197
262
|
sh 'gem release --tag --push'
|
data/rake_circle_ci.gemspec
CHANGED
|
@@ -33,10 +33,10 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
34
34
|
spec.require_paths = ['lib']
|
|
35
35
|
|
|
36
|
-
spec.required_ruby_version = '>= 3.
|
|
36
|
+
spec.required_ruby_version = '>= 3.3'
|
|
37
37
|
|
|
38
38
|
spec.add_dependency 'colored2', '~> 3.1'
|
|
39
|
-
spec.add_dependency 'excon', '
|
|
39
|
+
spec.add_dependency 'excon', '>= 0.72', '< 2.0'
|
|
40
40
|
spec.add_dependency 'rake_factory', '~> 0.33'
|
|
41
41
|
spec.add_dependency 'sshkey', '~> 2.0'
|
|
42
42
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake_circle_ci
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.14.0.pre.2
|
|
4
|
+
version: 0.14.0.pre.2.pr202.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- InfraBlocks Maintainers
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colored2
|
|
@@ -28,16 +28,22 @@ dependencies:
|
|
|
28
28
|
name: excon
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0.72'
|
|
34
|
+
- - "<"
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '2.0'
|
|
34
37
|
type: :runtime
|
|
35
38
|
prerelease: false
|
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
40
|
requirements:
|
|
38
|
-
- - "
|
|
41
|
+
- - ">="
|
|
39
42
|
- !ruby/object:Gem::Version
|
|
40
43
|
version: '0.72'
|
|
44
|
+
- - "<"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '2.0'
|
|
41
47
|
- !ruby/object:Gem::Dependency
|
|
42
48
|
name: rake_factory
|
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -110,7 +116,7 @@ licenses:
|
|
|
110
116
|
- MIT
|
|
111
117
|
metadata:
|
|
112
118
|
rubygems_mfa_required: 'false'
|
|
113
|
-
post_install_message:
|
|
119
|
+
post_install_message:
|
|
114
120
|
rdoc_options: []
|
|
115
121
|
require_paths:
|
|
116
122
|
- lib
|
|
@@ -118,15 +124,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
118
124
|
requirements:
|
|
119
125
|
- - ">="
|
|
120
126
|
- !ruby/object:Gem::Version
|
|
121
|
-
version: '3.
|
|
127
|
+
version: '3.3'
|
|
122
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
129
|
requirements:
|
|
124
|
-
- - "
|
|
130
|
+
- - ">="
|
|
125
131
|
- !ruby/object:Gem::Version
|
|
126
|
-
version:
|
|
132
|
+
version: '0'
|
|
127
133
|
requirements: []
|
|
128
|
-
rubygems_version: 3.
|
|
129
|
-
signing_key:
|
|
134
|
+
rubygems_version: 3.5.22
|
|
135
|
+
signing_key:
|
|
130
136
|
specification_version: 4
|
|
131
137
|
summary: Rake tasks for CircleCI projects.
|
|
132
138
|
test_files: []
|