forever_version 0.1.1 → 0.1.3

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: a59130e3618aa3a2a3301cc19bcd852923ab6b38deace37d4927e0f69e0d3e81
4
- data.tar.gz: 49b9920f7c705658f344b898502bc52857a132b08c99fc58b175051c16cf8b66
3
+ metadata.gz: 1b5542c6e60b8681a803a41269cc4f7b14382025c4ce6d17a1168f80a4547901
4
+ data.tar.gz: 7a31ebd559955e5f3217be0a87aaba4681fd934fe786aeab1bd921c36a272eb0
5
5
  SHA512:
6
- metadata.gz: f989df40c4dc95b3cef8baa5ef08a8a828314dabdebb403de671cd58209f138d47eda6bfed7d448efeb896b08dbc46dce95752dce02b510acddf66425d77464c
7
- data.tar.gz: d970966e7854693b683d17ebc7347aeb2a78a92753c32f776ae4c4ed413d8027da39f7deded0fc7b7fbe08f5fac65d33bd5e26eb935a30cbec8b4de77f222808
6
+ metadata.gz: 1e279c09a5365a18a5132cecfad89bcbb90fbbfc157f3fb37ea282039f2650658e3f12efa5c76657891c6962dee231326d4a19f4d19b87820ea3dfe2c39d1a95
7
+ data.tar.gz: 37c3cb4ad33ff0012c61f6ba61735a55e418f573ae824b7b7aeaaa075ce6d6f3f60a7b85d48a1faa50654b14bf8d9354e28ea7bd1b28e0352643441082e8a15d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- forever_version (0.1.1)
4
+ forever_version (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/SETUP.md ADDED
@@ -0,0 +1,126 @@
1
+ # Setup Instructions
2
+
3
+ This document explains how to set up the `forever_version` gem for automated releases and publishing to RubyGems.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. A GitHub repository for the gem
8
+ 2. A RubyGems account
9
+ 3. Admin access to the GitHub repository
10
+
11
+ ## GitHub Repository Setup
12
+
13
+ 1. **Create the repository** on GitHub and push your gem code
14
+ 2. **Enable GitHub Actions** (should be enabled by default)
15
+ 3. **Configure repository settings**:
16
+ - Go to Settings → Actions → General
17
+ - Under "Workflow permissions", select "Read and write permissions"
18
+ - Check "Allow GitHub Actions to create and approve pull requests"
19
+
20
+ ## RubyGems API Key Setup
21
+
22
+ 1. **Generate a RubyGems API Key**:
23
+ - Log in to [RubyGems.org](https://rubygems.org)
24
+ - Go to your account settings
25
+ - Click on "API Keys"
26
+ - Create a new API key with "Push rubygems" scope
27
+ - Copy the generated API key
28
+
29
+ 2. **Add the API key to GitHub Secrets**:
30
+ - Go to your GitHub repository
31
+ - Navigate to Settings → Secrets and variables → Actions
32
+ - Click "New repository secret"
33
+ - Name: `RUBYGEMS_API_KEY`
34
+ - Value: Paste the API key from RubyGems
35
+ - Click "Add secret"
36
+
37
+ ## Gem Configuration
38
+
39
+ 1. **Update the gemspec file** (`forever_version.gemspec`):
40
+ - Change the author name and email
41
+ - Update the homepage URL to your repository
42
+ - Update the source_code_uri to your repository
43
+
44
+ 2. **Update the README** if needed:
45
+ - Change any references to your username/repository
46
+
47
+ ## Testing the Setup
48
+
49
+ 1. **Test the workflows**:
50
+ - Go to Actions tab in your GitHub repository
51
+ - You should see the "Test" workflow run automatically on pushes
52
+ - You can manually trigger the "Automated Releases" workflow to test it
53
+
54
+ 2. **Verify permissions**:
55
+ - The automated release workflow needs write access to create releases
56
+ - The publish workflow needs the RubyGems API key to push gems
57
+
58
+ ## How It Works
59
+
60
+ ### Automated Releases (auto-release.yml)
61
+
62
+ - Runs every 4 hours via cron schedule
63
+ - Uses randomized thresholds to determine when to create releases:
64
+ - **Patch**: 8-16 hours since last release (80% probability when threshold met)
65
+ - **Minor**: 18-30 hours since last release (60% probability when threshold met)
66
+ - **Major**: 144-168 hours since last release (60% probability when threshold met)
67
+ - Updates the version in lib/forever_version/version.rb
68
+ - Creates a git commit and pushes it
69
+ - Creates a GitHub release with generated notes
70
+
71
+ ### Publish to RubyGems (publish-gem.yml)
72
+
73
+ - Triggers automatically when a GitHub release is published
74
+ - Builds the gem using the gemspec
75
+ - Publishes it to RubyGems using the API key
76
+ - Cleans up credentials after publishing
77
+
78
+ ## Manual Release
79
+
80
+ You can also create releases manually:
81
+
82
+ 1. Go to Actions → "Automated Releases"
83
+ 2. Click "Run workflow"
84
+ 3. Choose the release type (patch/minor/major)
85
+ 4. Click "Run workflow"
86
+
87
+ ## Troubleshooting
88
+
89
+ ### Common Issues
90
+
91
+ 1. **Permission denied errors**: Check that workflow permissions are set to "Read and write permissions"
92
+
93
+ 2. **RubyGems push fails**:
94
+ - Verify the API key is correct
95
+ - Check that the gem name is not already taken
96
+ - Ensure you have push permissions for the gem
97
+
98
+ 3. **Version conflicts**:
99
+ - Make sure the version in version.rb matches what is expected
100
+ - Check that you have not manually created conflicting releases
101
+
102
+ 4. **Workflow does not run**:
103
+ - Check that the cron syntax is correct
104
+ - Verify that Actions are enabled for the repository
105
+
106
+ ### Logs
107
+
108
+ - All workflow runs are logged in the Actions tab
109
+ - Check individual job logs for detailed error messages
110
+ - The workflows include debug output to help troubleshoot timing decisions
111
+
112
+ ## Security Notes
113
+
114
+ - The RubyGems API key is stored as a GitHub secret and is automatically masked in logs
115
+ - Credentials are cleaned up after each publish job
116
+ - The workflows only run on the main branch by default
117
+
118
+ ## Customization
119
+
120
+ To modify the release frequency:
121
+
122
+ 1. Edit the cron schedule in auto-release.yml
123
+ 2. Adjust the threshold calculations in the "Determine release type" step
124
+ 3. Modify the randomization percentages to change release probability
125
+
126
+ The current settings create a varied mix of releases with randomization for organic patterns.
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["kinduff@protonmail.com"]
10
10
 
11
11
  spec.summary = "Minimal implementation of forever versioning"
12
- spec.description = "Minimal implementation of forever versioning"
12
+ spec.description = "Minimal implementation of forever versioning using semantic versioning"
13
13
  spec.homepage = "https://github.com/lasagnapizza/forever_version"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 2.6.0"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForeverVersion
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forever_version
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kinduff
@@ -10,7 +10,7 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2026-02-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Minimal implementation of forever versioning
13
+ description: Minimal implementation of forever versioning using semantic versioning
14
14
  email:
15
15
  - kinduff@protonmail.com
16
16
  executables: []
@@ -21,6 +21,7 @@ files:
21
21
  - Gemfile.lock
22
22
  - LICENSE.txt
23
23
  - Rakefile
24
+ - SETUP.md
24
25
  - forever_version.gemspec
25
26
  - lib/forever_version.rb
26
27
  - lib/forever_version/version.rb