rake-gem-maintenance 0.1.6 → 0.1.7
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 +2 -2
- data/README.md +42 -48
- data/lib/rake/gem/maintenance/renew_api_key_task.rb +1 -1
- data/lib/rake/gem/maintenance/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b787e033da5eee96ab47d3b7aef6db19b4ba37cd00c5a6399df65382b7931cb
|
|
4
|
+
data.tar.gz: b621f3b580ade530a9da0848f65fa734f0bd5555cfb47ebed826ec91a9535727
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ccdac7428f63ab9a174667221f0071099784643d2a0087190fac484265cf8e54424c9f6b999778b5d00a5e1443f7f3eea307be8aa90599989d72d51aedac2487
|
|
7
|
+
data.tar.gz: 64c1c90ac23717da73b24edcb6b6753fd6f2fc5c6b1b0b1f090c43d5502c5f21ab549fee8bc3847ab705f335fc787d49732b9b5ccf2c9b198672576746fdde90
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rake-gem-maintenance (0.1.
|
|
4
|
+
rake-gem-maintenance (0.1.7)
|
|
5
5
|
bundler-audit
|
|
6
6
|
gem-release
|
|
7
7
|
rake
|
|
@@ -254,7 +254,7 @@ CHECKSUMS
|
|
|
254
254
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
255
255
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
256
256
|
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
257
|
-
rake-gem-maintenance (0.1.
|
|
257
|
+
rake-gem-maintenance (0.1.7)
|
|
258
258
|
rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe
|
|
259
259
|
rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e
|
|
260
260
|
rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192
|
data/README.md
CHANGED
|
@@ -48,78 +48,72 @@ end
|
|
|
48
48
|
|
|
49
49
|
## Automated Publishing to rubygems.org
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
generation if your rubygems.org account has MFA enabled.
|
|
51
|
+
### Step 1 — First-time setup (one-off, interactive)
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|---|---|
|
|
56
|
-
| `GEM_HOST_API_KEY` | rubygems.org API key (scoped to push) |
|
|
57
|
-
| `RUBYGEMS_OTP_SEED` | Base32 TOTP seed — auto-generates the 2FA code; omit if MFA is disabled |
|
|
58
|
-
|
|
59
|
-
### Quick setup
|
|
60
|
-
|
|
61
|
-
`require "rake/gem_maintenance/install_tasks"` pre-configures both env var names automatically —
|
|
62
|
-
no extra Ruby needed. See [features/install_tasks.feature](features/install_tasks.feature) for
|
|
63
|
-
the full workflow.
|
|
64
|
-
|
|
65
|
-
### Custom env var names
|
|
66
|
-
|
|
67
|
-
```ruby
|
|
68
|
-
require "rake/gem/maintenance"
|
|
69
|
-
|
|
70
|
-
Rake::GemMaintenance::Repos.rubygems_api_key_env_var = "MY_RUBYGEMS_KEY"
|
|
71
|
-
Rake::GemMaintenance::Repos.rubygems_otp_seed_env_var = "MY_OTP_SEED"
|
|
53
|
+
Run the renewal task once on your local machine:
|
|
72
54
|
|
|
73
|
-
|
|
55
|
+
```bash
|
|
56
|
+
rake upgrade:renew_api_key
|
|
74
57
|
```
|
|
75
58
|
|
|
76
|
-
|
|
77
|
-
for all configuration options including geminabox and dual publishing.
|
|
59
|
+
It will prompt for three things:
|
|
78
60
|
|
|
79
|
-
|
|
61
|
+
| Prompt | What to enter |
|
|
62
|
+
|---|---|
|
|
63
|
+
| username | Your rubygems.org username or email |
|
|
64
|
+
| password | Your rubygems.org password (never stored) |
|
|
65
|
+
| OTP seed | The **base32 secret** from your authenticator app setup — the long code shown when you first enabled MFA, *not* the rotating 6-digit code. Omit (press Enter) if MFA is disabled. |
|
|
80
66
|
|
|
81
|
-
After the
|
|
67
|
+
After answering, the task generates a scoped API key and saves it locally alongside your
|
|
68
|
+
username and OTP seed:
|
|
82
69
|
|
|
83
70
|
```
|
|
84
71
|
~/.config/rake-gem-maintenance/credentials.yml # Linux / Mac (respects $XDG_CONFIG_HOME)
|
|
85
72
|
%APPDATA%\rake-gem-maintenance\credentials.yml # Windows
|
|
86
73
|
```
|
|
87
74
|
|
|
88
|
-
The file is
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
The file is `0600` (owner-read-only on Unix). The **password is never written to disk**.
|
|
76
|
+
|
|
77
|
+
### Step 2 — All future local runs are automatic
|
|
78
|
+
|
|
79
|
+
Any project using `require "rake/gem_maintenance/install_tasks"` automatically reads the
|
|
80
|
+
credential file at startup and sets `GEM_HOST_API_KEY` and `RUBYGEMS_OTP_SEED` in the process
|
|
81
|
+
environment. Running `rake upgrade` needs no manual credential setup from this point on.
|
|
92
82
|
|
|
93
83
|
See [features/upgrade_task/credential_store.feature](features/upgrade_task/credential_store.feature)
|
|
94
84
|
for the full behaviour specification.
|
|
95
85
|
|
|
96
|
-
###
|
|
86
|
+
### Step 3 — CI setup (Woodpecker / GitHub Actions)
|
|
97
87
|
|
|
98
|
-
|
|
88
|
+
Set the following as CI secrets:
|
|
99
89
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
| Secret / env var | Purpose |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `RUBYGEMS_USERNAME` | rubygems.org username |
|
|
93
|
+
| `RUBYGEMS_PASSWORD` | rubygems.org password |
|
|
94
|
+
| `RUBYGEMS_OTP_SEED` | Same base32 seed as above |
|
|
95
|
+
| `GEM_HOST_API_KEY` | The API key generated in Step 1 (for the initial push) |
|
|
103
96
|
|
|
104
|
-
|
|
97
|
+
On subsequent runs the key is renewed automatically: when `gem push` returns 401/403, the
|
|
98
|
+
publisher transparently calls `upgrade:renew_api_key` and retries. The refreshed key is written
|
|
99
|
+
back to the `rubygems_api_key` CI secret (requires `WOODPECKER_TOKEN` + `WOODPECKER_SERVER`
|
|
100
|
+
when running under Woodpecker CI).
|
|
105
101
|
|
|
106
|
-
|
|
107
|
-
rake upgrade:renew_api_key
|
|
108
|
-
```
|
|
102
|
+
See [features/upgrade_task/renew_api_key.feature](features/upgrade_task/renew_api_key.feature).
|
|
109
103
|
|
|
110
|
-
|
|
111
|
-
unattended operation:
|
|
104
|
+
### Custom env var names
|
|
112
105
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
| `RUBYGEMS_USERNAME` | rubygems.org account username or email |
|
|
116
|
-
| `RUBYGEMS_PASSWORD` | rubygems.org account password |
|
|
117
|
-
| `RUBYGEMS_OTP_SEED` | Same TOTP seed as above — reused here to authenticate the key-creation request |
|
|
106
|
+
```ruby
|
|
107
|
+
require "rake/gem/maintenance"
|
|
118
108
|
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
Rake::GemMaintenance::Repos.rubygems_api_key_env_var = "MY_RUBYGEMS_KEY"
|
|
110
|
+
Rake::GemMaintenance::Repos.rubygems_otp_seed_env_var = "MY_OTP_SEED"
|
|
121
111
|
|
|
122
|
-
|
|
112
|
+
Rake::GemMaintenance::UpgradeTask.new
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
See [features/upgrade_task/repos_configuration.feature](features/upgrade_task/repos_configuration.feature)
|
|
116
|
+
for all configuration options including geminabox and dual publishing.
|
|
123
117
|
|
|
124
118
|
## License
|
|
125
119
|
|
|
@@ -57,7 +57,7 @@ module Rake
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def generate_api_key(username, password)
|
|
60
|
-
otp = OtpProvider.new.otp_for("rubygems")
|
|
60
|
+
otp = OtpProvider.new.otp_for("rubygems", otp_seed_env_var: "RUBYGEMS_OTP_SEED")
|
|
61
61
|
RubyGemsApiKeyCreator.new(host: host).create(username, password, otp: otp)
|
|
62
62
|
end
|
|
63
63
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake-gem-maintenance
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christophe Broult
|
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
125
|
- !ruby/object:Gem::Version
|
|
126
126
|
version: '0'
|
|
127
127
|
requirements: []
|
|
128
|
-
rubygems_version: 4.0.
|
|
128
|
+
rubygems_version: 4.0.10
|
|
129
129
|
specification_version: 4
|
|
130
130
|
summary: 'Rake tasks for gem maintenance: dependency upgrades and version bumps.'
|
|
131
131
|
test_files: []
|