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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6dc9985cb348ee5f79a3170eb6ef534b5fe8bc1aad6361be15178f883ba22767
4
- data.tar.gz: e819c2d3f58a936c59fb8caf620f84e92dc68bf59cee8f592bb852c03d02de62
3
+ metadata.gz: 5b787e033da5eee96ab47d3b7aef6db19b4ba37cd00c5a6399df65382b7931cb
4
+ data.tar.gz: b621f3b580ade530a9da0848f65fa734f0bd5555cfb47ebed826ec91a9535727
5
5
  SHA512:
6
- metadata.gz: 43b4d7dec762bcefd6cd816f4c7a8c05a5e091929937f6e329801a6d4ff211fabdac4631f449d39501807b408f0f1411dc97637519857da49911cafa5bd108f6
7
- data.tar.gz: 81d529473f1404940f0cc45d1011af5d1930506f972b2485cbe190f184cd53a820cbfaa683201ec0b8ef85e63f2d50714cf337780087a94704071a5ef82d735c
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.6)
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.6)
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
- Set two environment variables and `gem push` runs fully unattended including TOTP 2FA code
52
- generation if your rubygems.org account has MFA enabled.
51
+ ### Step 1First-time setup (one-off, interactive)
53
52
 
54
- | Env var | Purpose |
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
- Rake::GemMaintenance::UpgradeTask.new
55
+ ```bash
56
+ rake upgrade:renew_api_key
74
57
  ```
75
58
 
76
- See [features/upgrade_task/repos_configuration.feature](features/upgrade_task/repos_configuration.feature)
77
- for all configuration options including geminabox and dual publishing.
59
+ It will prompt for three things:
78
60
 
79
- ### Local credential store
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 first successful `upgrade:renew_api_key` run, the API key and OTP seed are saved to:
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 created with `0600` permissions (owner-read-only on Unix). It stores `username`,
89
- `gem_host_api_key`, and `rubygems_otp_seed` — **never the password**. Any project using
90
- `require "rake/gem_maintenance/install_tasks"` automatically loads the key and OTP seed from
91
- this file at startup, so `gem push` works without any manual env-var setup.
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
- ### API key renewal
86
+ ### Step 3 — CI setup (Woodpecker / GitHub Actions)
97
87
 
98
- API keys can be rotated in two ways:
88
+ Set the following as CI secrets:
99
89
 
100
- **Automatic** when `gem push` returns a 401/403, the publisher transparently obtains a new
101
- key using `RUBYGEMS_USERNAME` + `RUBYGEMS_PASSWORD` (+ TOTP from `RUBYGEMS_OTP_SEED` if MFA is
102
- enabled), then retries the push once. No intervention needed.
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
- **On-demand** run the task explicitly to rotate ahead of expiry:
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
- ```bash
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
- Locally this prompts for credentials interactively. In CI, supply all three env vars for
111
- unattended operation:
104
+ ### Custom env var names
112
105
 
113
- | Env var | Purpose |
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
- The new key is written back to the `GEM_HOST_API_KEY` CI secret automatically (requires
120
- `WOODPECKER_TOKEN` and `WOODPECKER_SERVER` when running under Woodpecker CI).
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
- See [features/upgrade_task/renew_api_key.feature](features/upgrade_task/renew_api_key.feature).
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rake
4
4
  module GemMaintenance
5
- VERSION = "0.1.6"
5
+ VERSION = "0.1.7"
6
6
  end
7
7
  end
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.6
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.11
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: []