forever_version 0.1.1 → 0.1.2
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/SETUP.md +126 -0
- data/forever_version.gemspec +1 -1
- data/lib/forever_version/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef9f8b7c684de3f5c7039d3ae2d923242dd4e7c8369480446ff1bb8ce4a553e2
|
|
4
|
+
data.tar.gz: 199d930cce2090f4528cd47eab446f0f977346a01b9d759acd7750b4b1d50405
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f55d8be41e452e3cef2406d95efbf034d74d7d31cc82af05df4d23aee8dc78a108edb0ae16f421fea5a30a31ac8dac668c093c4452eb81836b8586fb68badcad
|
|
7
|
+
data.tar.gz: 5c6a0b6996723f779f0514002e5bec234ebddbc3ce4dd901ec683d7b496d4230fa5d511187675145c52e6de69b1290ec0959cd94cc8c53610fd90689535c5399
|
data/Gemfile.lock
CHANGED
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.
|
data/forever_version.gemspec
CHANGED
|
@@ -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"
|
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.
|
|
4
|
+
version: 0.1.2
|
|
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
|