rake_github 0.18.0.pre.2 → 0.18.0.pre.2.pr174.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccf58bc08cbcf3b39a39854fc969f7cf76ded28a90f4c7b015c7dfc7947b4b65
4
- data.tar.gz: 05fd4a73ce650381080ed72368071f53d0facee56f2bf729cfd089bf523d1eea
3
+ metadata.gz: d97d3856ffdc0068f2dc712102b910a375125912f9c46c418c9bcd1354b802ff
4
+ data.tar.gz: e7d271a52585799e53c20ed0d53c9522f365d9664c394ea5069c07abddb2af14
5
5
  SHA512:
6
- metadata.gz: 19c5fba62b0d27afc84b27556cd0ba0b54f9bb4f5415d892d6676b79e4172c048d54d3f2d844c8846993f461ff348e2e49e13df0fe13e5794bcb9a7b0fa41c94
7
- data.tar.gz: 33f666626a5df304a832f319b133a8b1a4cfaeb485727acafbb52cf1964eaae7ac758092ee49f80e5c0d1fad15c28108bc791272012df081edb722f3fb2af6f3
6
+ metadata.gz: d4e165b9f788f2eb7871d9c6780d79d7643048f613a8b66bf8a5b31b7823844076e16ae491af5cec2bac83cf256897a9ef1ee80c63f30c8bb19a7c262b736968
7
+ data.tar.gz: '038edccd469f4ae097c42f856b5a78d3f926e316e04c5edcaf97cfc4a5dcb9581c583683ac88dc4bf93ec2d5813acd13ac3001b814ff944e2b33389998ec33ad'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_github (0.18.0.pre.2)
4
+ rake_github (0.18.0.pre.2.pr174.1.1)
5
5
  colored2 (~> 3.1)
6
6
  octokit (>= 7.0, < 11.0)
7
7
  rake_factory (~> 0.33)
@@ -11,49 +11,51 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (7.2.2.1)
14
+ activesupport (8.1.3)
15
15
  base64
16
- benchmark (>= 0.3)
17
16
  bigdecimal
18
17
  concurrent-ruby (~> 1.0, >= 1.3.1)
19
18
  connection_pool (>= 2.2.5)
20
19
  drb
21
20
  i18n (>= 1.6, < 2)
21
+ json
22
22
  logger (>= 1.4.2)
23
23
  minitest (>= 5.1)
24
24
  securerandom (>= 0.3)
25
25
  tzinfo (~> 2.0, >= 2.0.5)
26
- addressable (2.8.7)
27
- public_suffix (>= 2.0.2, < 7.0)
26
+ uri (>= 0.13.1)
27
+ addressable (2.9.0)
28
+ public_suffix (>= 2.0.2, < 8.0)
28
29
  ast (2.4.3)
29
- base64 (0.2.0)
30
- benchmark (0.4.0)
31
- bigdecimal (3.1.8)
30
+ base64 (0.3.0)
31
+ bigdecimal (4.1.2)
32
32
  childprocess (5.0.0)
33
33
  colored2 (3.1.2)
34
- concurrent-ruby (1.3.4)
35
- connection_pool (2.4.1)
34
+ concurrent-ruby (1.3.8)
35
+ connection_pool (3.0.2)
36
36
  diff-lcs (1.6.2)
37
37
  docile (1.4.0)
38
- drb (2.2.1)
39
- excon (0.111.0)
40
- faraday (2.13.0)
38
+ drb (2.2.3)
39
+ excon (1.6.0)
40
+ logger
41
+ faraday (2.14.3)
41
42
  faraday-net_http (>= 2.0, < 3.5)
42
43
  json
43
44
  logger
44
- faraday-net_http (3.4.0)
45
- net-http (>= 0.5.0)
45
+ faraday-net_http (3.4.4)
46
+ net-http (~> 0.5)
46
47
  ffi (1.17.4)
48
+ ffi (1.17.4-x86_64-linux-gnu)
47
49
  gem-release (2.2.4)
48
50
  git (1.19.1)
49
51
  addressable (~> 2.8)
50
52
  rchardet (~> 1.8)
51
53
  hamster (3.0.0)
52
54
  concurrent-ruby (~> 1.0)
53
- i18n (1.14.6)
55
+ i18n (1.15.2)
54
56
  concurrent-ruby (~> 1.0)
55
- immutable-struct (2.4.1)
56
- json (2.12.2)
57
+ immutable-struct (2.5.0)
58
+ json (2.21.1)
57
59
  language_server-protocol (3.17.0.5)
58
60
  lino (4.1.0)
59
61
  childprocess (~> 5.0.0)
@@ -62,9 +64,9 @@ GEM
62
64
  lint_roller (1.1.0)
63
65
  logger (1.7.0)
64
66
  memfs (1.0.0)
65
- minitest (5.25.4)
66
- net-http (0.6.0)
67
- uri
67
+ minitest (5.27.0)
68
+ net-http (0.9.1)
69
+ uri (>= 0.11.1)
68
70
  octokit (10.0.0)
69
71
  faraday (>= 1, < 3)
70
72
  sawyer (~> 0.9)
@@ -74,15 +76,10 @@ GEM
74
76
  ast (~> 2.4.1)
75
77
  racc
76
78
  prism (1.4.0)
77
- public_suffix (6.0.1)
79
+ public_suffix (7.0.5)
78
80
  racc (1.8.1)
79
81
  rainbow (3.1.1)
80
- rake (13.3.0)
81
- rake_circle_ci (0.13.0)
82
- colored2 (~> 3.1)
83
- excon (~> 0.72)
84
- rake_factory (~> 0.33)
85
- sshkey (~> 2.0)
82
+ rake (13.4.2)
86
83
  rake_factory (0.33.0)
87
84
  activesupport (>= 4)
88
85
  rake (~> 13.0)
@@ -90,18 +87,18 @@ GEM
90
87
  colored2 (~> 3.1)
91
88
  git (~> 1.13, >= 1.13.2)
92
89
  rake_factory (~> 0.33)
93
- rake_git_crypt (0.2.0)
90
+ rake_git_crypt (0.4.0)
94
91
  colored2 (~> 3.1)
92
+ lino (~> 4.1)
95
93
  rake_factory (~> 0.33)
96
94
  ruby_git_crypt (~> 0.1)
97
95
  ruby_gpg2 (~> 0.12)
98
96
  rake_gpg (0.20.0)
99
97
  rake_factory (~> 0.33)
100
98
  ruby_gpg2 (~> 0.12)
101
- rake_ssh (0.12.0)
102
- colored2 (~> 3.1)
99
+ rake_slack (0.3.0)
100
+ excon (>= 0.72, < 2.0)
103
101
  rake_factory (~> 0.33)
104
- sshkey (~> 2.0)
105
102
  rbnacl (7.1.2)
106
103
  ffi (~> 1)
107
104
  rchardet (1.8.0)
@@ -145,10 +142,10 @@ GEM
145
142
  lino (>= 4.1)
146
143
  ruby_gpg2 (0.12.0)
147
144
  lino (>= 4.1)
148
- sawyer (0.9.2)
145
+ sawyer (0.9.3)
149
146
  addressable (>= 2.3.5)
150
147
  faraday (>= 0.17.3, < 3)
151
- securerandom (0.4.0)
148
+ securerandom (0.4.1)
152
149
  simplecov (0.22.0)
153
150
  docile (~> 1.1)
154
151
  simplecov-html (~> 0.11)
@@ -165,6 +162,7 @@ GEM
165
162
 
166
163
  PLATFORMS
167
164
  ruby
165
+ x86_64-linux
168
166
 
169
167
  DEPENDENCIES
170
168
  activesupport
@@ -172,12 +170,11 @@ DEPENDENCIES
172
170
  gem-release
173
171
  memfs
174
172
  rake
175
- rake_circle_ci
176
173
  rake_git
177
174
  rake_git_crypt
178
175
  rake_github!
179
176
  rake_gpg
180
- rake_ssh
177
+ rake_slack
181
178
  rspec
182
179
  rubocop
183
180
  rubocop-rake
data/README.md CHANGED
@@ -51,7 +51,7 @@ RakeGithub.define_repository_tasks(
51
51
  t.access_token = "your_github_access_token" # required
52
52
  t.deploy_keys = [
53
53
  {
54
- title: 'CircleCI',
54
+ title: 'Deploy Key',
55
55
  public_key: File.read('path/to/your_deploy_key.public')
56
56
  }
57
57
  ]
@@ -268,16 +268,16 @@ release a new version, update the version number in `version.rb`, and then run
268
268
  git commits and tags, and push the `.gem` file to
269
269
  [rubygems.org](https://rubygems.org).
270
270
 
271
- ### Managing CircleCI keys
271
+ ### Managing CI keys
272
272
 
273
- To encrypt a GPG key for use by CircleCI:
273
+ To encrypt a GPG key for use by CI:
274
274
 
275
275
  ```bash
276
276
  openssl aes-256-cbc \
277
277
  -e \
278
278
  -md sha1 \
279
279
  -in ./config/secrets/ci/gpg.private \
280
- -out ./.circleci/gpg.private.enc \
280
+ -out ./.github/gpg.private.enc \
281
281
  -k "<passphrase>"
282
282
  ```
283
283
 
@@ -287,7 +287,7 @@ To check decryption is working correctly:
287
287
  openssl aes-256-cbc \
288
288
  -d \
289
289
  -md sha1 \
290
- -in ./.circleci/gpg.private.enc \
290
+ -in ./.github/gpg.private.enc \
291
291
  -k "<passphrase>"
292
292
  ```
293
293
 
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 'rake_ssh'
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',
@@ -91,7 +82,6 @@ namespace :secrets do
91
82
  desc 'Generate all generatable secrets.'
92
83
  task generate: %w[
93
84
  encryption:passphrase:generate
94
- keys:deploy:generate
95
85
  keys:gpg:generate
96
86
  ]
97
87
 
@@ -115,57 +105,98 @@ namespace :library do
115
105
 
116
106
  desc 'Attempt to automatically fix issues with the library'
117
107
  task fix: [:'rubocop:autocorrect_all']
108
+
109
+ desc 'Build the library'
110
+ task :build do
111
+ sh 'gem build rake_github.gemspec'
112
+ end
118
113
  end
119
114
 
120
115
  namespace :test do
121
116
  RSpec::Core::RakeTask.new(:unit)
122
117
  end
123
118
 
124
- RakeCircleCI.define_project_tasks(
125
- namespace: :circle_ci,
126
- project_slug: 'github/infrablocks/rake_github'
127
- ) do |t|
128
- circle_ci_config =
129
- YAML.load_file('config/secrets/circle_ci/config.yaml')
130
-
131
- t.api_token = circle_ci_config['circle_ci_api_token']
132
- t.environment_variables = {
133
- ENCRYPTION_PASSPHRASE:
134
- File.read('config/secrets/ci/encryption.passphrase')
135
- .chomp
136
- }
137
- t.checkout_keys = []
138
- t.ssh_keys = [
139
- {
140
- hostname: 'github.com',
141
- private_key: File.read('config/secrets/ci/ssh.private')
142
- }
143
- ]
144
- end
145
-
146
119
  RakeGithub.define_repository_tasks(
147
120
  namespace: :github,
148
121
  repository: 'infrablocks/rake_github'
149
122
  ) do |t|
150
- github_config =
151
- YAML.load_file('config/secrets/github/config.yaml')
152
-
153
- t.access_token = github_config['github_personal_access_token']
154
- t.deploy_keys = [
155
- {
156
- title: 'CircleCI',
157
- public_key: File.read('config/secrets/ci/ssh.public')
158
- }
123
+ # Operator's ambient auth. Resolve once and fail fast: a missing,
124
+ # unauthenticated, or absent gh yields an empty string, which would
125
+ # otherwise surface later as an opaque Octokit 401. An empty or
126
+ # whitespace-only GITHUB_TOKEN is treated as absent so an authenticated
127
+ # operator falls through to `gh auth token` rather than hitting the raise.
128
+ github_token = ENV['GITHUB_TOKEN'].to_s.strip
129
+ if github_token.empty?
130
+ github_token = begin
131
+ `gh auth token`
132
+ rescue Errno::ENOENT
133
+ ''
134
+ end.strip
135
+ end
136
+ if github_token.empty?
137
+ raise 'No GitHub token available: set GITHUB_TOKEN or run `gh auth login`'
138
+ end
139
+
140
+ t.access_token = github_token
141
+
142
+ # Actions store only: dependabot runs never reach the passphrase — the
143
+ # only pr.yaml job that unlocks git-crypt (prerelease) is guarded to
144
+ # same-repo human PRs. Guard against a locked clone: without
145
+ # it, File.read returns git-crypt ciphertext and github:secrets:ensure
146
+ # silently uploads garbage that only surfaces much later as an opaque
147
+ # GPG unlock failure in the release job.
148
+ passphrase_path = 'config/secrets/ci/encryption.passphrase'
149
+ unless File.exist?(passphrase_path)
150
+ raise "Passphrase file not found: #{passphrase_path} — expected a " \
151
+ 'git-crypt-unlocked clone with the CI secrets present'
152
+ end
153
+ passphrase = File.binread(passphrase_path)
154
+ if passphrase.start_with?("\x00GITCRYPT")
155
+ raise 'encryption.passphrase is git-crypt ciphertext — unlock the ' \
156
+ 'clone before provisioning'
157
+ end
158
+ t.secrets = [
159
+ { name: 'ENCRYPTION_PASSPHRASE', value: passphrase.chomp }
159
160
  ]
161
+ t.environments = [
162
+ { name: 'release',
163
+ reviewers: [{ team: 'maintainers' }] }
164
+ ]
165
+ end
166
+
167
+ namespace :slack do
168
+ RakeSlack.define_notification_tasks do |t|
169
+ t.bot_token = ENV.fetch('SLACK_BOT_TOKEN', nil)
170
+ t.routing_rules = [
171
+ { when: { type: 'on_hold' },
172
+ channel: 'C038EDCRSQJ', format: :on_hold }, # release
173
+ { when: { actor: 'dependabot[bot]', outcome: 'success' },
174
+ channel: 'C03N711HVDG', format: :success }, # builds-dependabot
175
+ { when: { actor: 'dependabot[bot]' },
176
+ channel: 'C03N711HVDG', format: :failure }, # builds-dependabot
177
+ { when: { outcome: 'success' },
178
+ channel: 'C023XUE76GH', format: :success }, # builds
179
+ # Failures go to builds, not team-dev (org default), to keep noise
180
+ # out of a popular channel while this pipeline beds in.
181
+ { when: {},
182
+ channel: 'C023XUE76GH', format: :failure } # builds
183
+ ]
184
+ end
185
+ end
186
+
187
+ namespace :repository do
188
+ desc 'Set the git author for CI'
189
+ task :set_ci_author do
190
+ sh 'git config --global user.name "InfraBlocks CI"'
191
+ sh 'git config --global user.email "ci@infrablocks.io"'
192
+ end
160
193
  end
161
194
 
162
195
  namespace :pipeline do
163
- desc 'Prepare CircleCI Pipeline'
196
+ desc 'Prepare GitHub Actions pipeline'
164
197
  task prepare: %i[
165
- circle_ci:env_vars:ensure
166
- circle_ci:checkout_keys:ensure
167
- circle_ci:ssh_keys:ensure
168
- github:deploy_keys:ensure
198
+ github:secrets:ensure
199
+ github:environments:ensure
169
200
  ]
170
201
  end
171
202
 
@@ -176,6 +207,38 @@ namespace :version do
176
207
  end
177
208
  end
178
209
 
210
+ namespace :prerelease do
211
+ desc 'Build and push a namespaced pre-release to RubyGems ' \
212
+ '(PR CI only; no bump, no tag, no commit, no push)'
213
+ task :publish, %i[pr_number run_number run_attempt] do |_, args|
214
+ %i[pr_number run_number run_attempt].each do |name|
215
+ raise "Missing task argument: #{name}" if args[name].to_s.empty?
216
+ end
217
+
218
+ version_file = 'lib/rake_github/version.rb'
219
+ version_pattern = /(VERSION\s*=\s*')([^']+)(')/
220
+ source = File.read(version_file)
221
+ base = source[version_pattern, 2]
222
+ raise "Could not read VERSION from #{version_file}" unless base
223
+
224
+ version = "#{base}.pr#{args.pr_number}" \
225
+ ".#{args.run_number}.#{args.run_attempt}"
226
+ gem_file = "rake_github-#{version}.gem"
227
+ begin
228
+ File.write(version_file,
229
+ source.sub(version_pattern, "\\1#{version}\\3"))
230
+ # Build + push directly: `gem release` aborts on the (deliberately)
231
+ # uncommitted version rewrite. PR CI must not tag, commit, or push
232
+ # (contrast the `release` task).
233
+ sh 'gem build rake_github.gemspec'
234
+ sh "gem push #{gem_file}"
235
+ ensure
236
+ File.write(version_file, source)
237
+ rm_f gem_file
238
+ end
239
+ end
240
+ end
241
+
179
242
  desc 'Release gem'
180
243
  task :release do
181
244
  sh 'gem release --tag --push'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RakeGithub
4
- VERSION = '0.18.0.pre.2'
4
+ VERSION = '0.18.0.pre.2.pr174.1.1'
5
5
  end
data/rake_github.gemspec CHANGED
@@ -46,12 +46,11 @@ Gem::Specification.new do |spec|
46
46
  spec.add_development_dependency 'gem-release'
47
47
  spec.add_development_dependency 'memfs'
48
48
  spec.add_development_dependency 'rake'
49
- spec.add_development_dependency 'rake_circle_ci'
50
49
  spec.add_development_dependency 'rake_git'
51
50
  spec.add_development_dependency 'rake_git_crypt'
52
51
  spec.add_development_dependency 'rake_github'
53
52
  spec.add_development_dependency 'rake_gpg'
54
- spec.add_development_dependency 'rake_ssh'
53
+ spec.add_development_dependency 'rake_slack'
55
54
  spec.add_development_dependency 'rspec'
56
55
  spec.add_development_dependency 'rubocop'
57
56
  spec.add_development_dependency 'rubocop-rake'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0.pre.2
4
+ version: 0.18.0.pre.2.pr174.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-10 00:00:00.000000000 Z
11
+ date: 2026-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2
@@ -156,20 +156,6 @@ dependencies:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
- - !ruby/object:Gem::Dependency
160
- name: rake_circle_ci
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: '0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: '0'
173
159
  - !ruby/object:Gem::Dependency
174
160
  name: rake_git
175
161
  requirement: !ruby/object:Gem::Requirement
@@ -227,7 +213,7 @@ dependencies:
227
213
  - !ruby/object:Gem::Version
228
214
  version: '0'
229
215
  - !ruby/object:Gem::Dependency
230
- name: rake_ssh
216
+ name: rake_slack
231
217
  requirement: !ruby/object:Gem::Requirement
232
218
  requirements:
233
219
  - - ">="