rake_npm 0.3.0.pre.2.pr69.1.1 → 0.3.0.pre.2.pr69.2.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.lock +1 -1
- data/Rakefile +46 -39
- data/lib/rake_npm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b0b31ed83b24103dd072ddb101dcd02f1ddfab5675920b91a8aebb7f8c5e5e7
|
|
4
|
+
data.tar.gz: a543d821297c7f144a3c51ab720d5429023fb55f25fc524ff8bae55b0a051b8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a498d3a7afb5967735f56c792830361068e84811603fc1e3f83911bef69731503ee4ca15d0209bb0a5aec6a9912a86700a2251080d182674b4a33f60fbdd592b
|
|
7
|
+
data.tar.gz: 1e633190e3dc74cef8f0f37690606366d542d43e656f0b9c64adbda25fb134f43a529d333e70ba5ee63920fcf7cc92461eadd9fdf4a121f22b81da63c11f7c28
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
|
@@ -120,43 +120,9 @@ RakeGithub.define_repository_tasks(
|
|
|
120
120
|
namespace: :github,
|
|
121
121
|
repository: 'infrablocks/rake_npm'
|
|
122
122
|
) do |t|
|
|
123
|
-
|
|
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
|
|
123
|
+
t.access_token = ambient_github_token
|
|
158
124
|
t.secrets = [
|
|
159
|
-
{ name: 'ENCRYPTION_PASSPHRASE', value:
|
|
125
|
+
{ name: 'ENCRYPTION_PASSPHRASE', value: ci_encryption_passphrase }
|
|
160
126
|
]
|
|
161
127
|
t.environments = [
|
|
162
128
|
{ name: 'release',
|
|
@@ -207,6 +173,11 @@ namespace :version do
|
|
|
207
173
|
end
|
|
208
174
|
end
|
|
209
175
|
|
|
176
|
+
desc 'Release gem'
|
|
177
|
+
task :release do
|
|
178
|
+
sh 'gem release --tag --push'
|
|
179
|
+
end
|
|
180
|
+
|
|
210
181
|
namespace :prerelease do
|
|
211
182
|
desc 'Build and push a namespaced pre-release to RubyGems ' \
|
|
212
183
|
'(PR CI only; no bump, no tag, no commit, no push)'
|
|
@@ -239,9 +210,45 @@ namespace :prerelease do
|
|
|
239
210
|
end
|
|
240
211
|
end
|
|
241
212
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
213
|
+
# Operator's ambient auth. Resolve once and fail fast: a missing,
|
|
214
|
+
# unauthenticated, or absent gh yields an empty string, which would
|
|
215
|
+
# otherwise surface later as an opaque Octokit 401. An empty or
|
|
216
|
+
# whitespace-only GITHUB_TOKEN is treated as absent so an authenticated
|
|
217
|
+
# operator falls through to `gh auth token` rather than hitting the raise.
|
|
218
|
+
def ambient_github_token
|
|
219
|
+
token = ENV['GITHUB_TOKEN'].to_s.strip
|
|
220
|
+
token = gh_auth_token if token.empty?
|
|
221
|
+
if token.empty?
|
|
222
|
+
raise 'No GitHub token available: set GITHUB_TOKEN or run `gh auth login`'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
token
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def gh_auth_token
|
|
229
|
+
`gh auth token`.strip
|
|
230
|
+
rescue Errno::ENOENT
|
|
231
|
+
''
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Actions store only: dependabot runs never reach the passphrase — the only
|
|
235
|
+
# pr.yaml job that unlocks git-crypt (prerelease) is guarded to same-repo
|
|
236
|
+
# human PRs. Guard against a locked clone: without it, File.read returns
|
|
237
|
+
# git-crypt ciphertext and github:secrets:ensure silently uploads garbage
|
|
238
|
+
# that only surfaces much later as an opaque GPG unlock failure in the
|
|
239
|
+
# release job.
|
|
240
|
+
def ci_encryption_passphrase
|
|
241
|
+
path = 'config/secrets/ci/encryption.passphrase'
|
|
242
|
+
unless File.exist?(path)
|
|
243
|
+
raise "Passphrase file not found: #{path} — unlock the clone first"
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
passphrase = File.binread(path)
|
|
247
|
+
if passphrase.start_with?("\x00GITCRYPT")
|
|
248
|
+
raise 'encryption.passphrase is git-crypt ciphertext — unlock first'
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
passphrase.chomp
|
|
245
252
|
end
|
|
246
253
|
|
|
247
254
|
def bump_version_for(version_type)
|
data/lib/rake_npm/version.rb
CHANGED