discharger 0.2.11 → 0.2.13
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/CHANGELOG.md +27 -0
- data/README.md +66 -27
- data/Rakefile +1 -0
- data/lib/discharger/task.rb +5 -0
- data/lib/discharger/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ce45e28ffd20d694eec7075403138701e726efbaef6f5b5000e51c34eca3961
|
4
|
+
data.tar.gz: f378cf858c863d47255ea695ed95daf676c7943ea1ac7d5f4f2044cb04604d17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466259f1fd4d919e807694c007e59292eeaa8ef2d5f3b50e8ae7fdb2ae5514e2cec983c903c4d6667ec16fc8a7129c0b28146cc21eb9bc721f6129d37c872267
|
7
|
+
data.tar.gz: 8e99e498e7c594b168e8835fad33111ec2b8d4e08d96a2434cae97c9bebcd71ba55a48ab7cf50a59eaae976651b74503001a424d06fcbc82e250fc192924e86a
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
|
+
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
|
+
|
8
|
+
## [0.2.13] - 2025-09-02
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Added clean up fragment_directory task on Task.
|
13
|
+
- Added trusted publisher flow to GitHub release action.
|
14
|
+
- Adding commit step if needed after the finalize.
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Fixed version on GitHub trusted publisher action.
|
19
|
+
- Added debugging for OIDC.
|
20
|
+
- Switching back to version 1.0.0 for trusted publisher
|
21
|
+
- Now going for the official RubyGems GitHub action for the gem publishing.
|
22
|
+
|
23
|
+
## [0.2.12] - 2025-08-19
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- Added fragment directory attribute for task configuration.
|
data/README.md
CHANGED
@@ -1,26 +1,80 @@
|
|
1
1
|
# Discharger
|
2
|
-
Code supporting tasks that discharge code for deployment.
|
3
2
|
|
4
|
-
|
3
|
+
A Ruby gem that provides Rake tasks for managing code deployment workflows with automated versioning, changelog management, and Slack notifications.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "discharger"
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
```bash
|
15
|
+
$ bundle install
|
16
|
+
```
|
17
|
+
|
18
|
+
Then run the install generator:
|
19
|
+
```bash
|
20
|
+
$ rails generate discharger:install
|
21
|
+
```
|
5
22
|
|
6
|
-
|
23
|
+
Or install it yourself as:
|
24
|
+
```bash
|
25
|
+
$ gem install discharger
|
26
|
+
```
|
7
27
|
|
8
|
-
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
Add `require "discharger/task"` to your Rakefile, then configure the discharger task:
|
9
31
|
|
10
32
|
```ruby
|
11
33
|
require "discharger/task"
|
12
34
|
|
13
35
|
Discharger::Task.create do |task|
|
36
|
+
# Version management
|
14
37
|
task.version_file = "config/application.rb"
|
15
|
-
task.release_message_channel = "#some-slack-channel"
|
16
38
|
task.version_constant = "MyApp::VERSION"
|
17
|
-
|
39
|
+
|
40
|
+
# Slack integration
|
41
|
+
task.release_message_channel = "#some-slack-channel"
|
42
|
+
task.app_name = "My App Name"
|
43
|
+
|
44
|
+
# Git integration
|
18
45
|
task.commit_identifier = -> { `git rev-parse HEAD`.strip }
|
19
46
|
task.pull_request_url = "https://github.com/SOFware/some-app"
|
47
|
+
|
48
|
+
# Changelog management (optional)
|
49
|
+
task.fragment_directory = "changelog.d" # Directory for changelog fragments
|
20
50
|
end
|
21
51
|
```
|
22
52
|
|
23
|
-
|
53
|
+
### Changelog Fragments
|
54
|
+
|
55
|
+
Discharger supports changelog fragment management through the `fragment_directory` setting. When set, Discharger will look for changelog fragments in the specified directory and automatically combine them into the main changelog during releases.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
Discharger::Task.create do |task|
|
59
|
+
# ... other configuration ...
|
60
|
+
task.fragment_directory = "changelog.d" # Default: nil (disabled)
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
With fragments enabled, you can create individual changelog files in the `changelog.d/` directory:
|
65
|
+
|
66
|
+
```
|
67
|
+
changelog.d/
|
68
|
+
├── 123-fix-login-bug.md
|
69
|
+
├── 124-add-user-profile.md
|
70
|
+
└── 125-update-dependencies.md
|
71
|
+
```
|
72
|
+
|
73
|
+
Each fragment file should contain the changelog entry for a specific change or feature.
|
74
|
+
|
75
|
+
## Available Tasks
|
76
|
+
|
77
|
+
The gem creates several Rake tasks for managing your deployment workflow:
|
24
78
|
|
25
79
|
```bash
|
26
80
|
$ rake -T release
|
@@ -32,27 +86,11 @@ rake release:slack[text,channel,emoji] # Send a message to Slack
|
|
32
86
|
rake release:stage # ---------- STEP 2 ----------
|
33
87
|
```
|
34
88
|
|
35
|
-
|
36
|
-
Add this line to your application's Gemfile:
|
89
|
+
### Workflow Steps
|
37
90
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
And then execute:
|
43
|
-
```bash
|
44
|
-
$ bundle
|
45
|
-
```
|
46
|
-
|
47
|
-
Then run the install generator:
|
48
|
-
```bash
|
49
|
-
$ rails generate discharger:install
|
50
|
-
```
|
51
|
-
|
52
|
-
Or install it yourself as:
|
53
|
-
```bash
|
54
|
-
$ gem install discharger
|
55
|
-
```
|
91
|
+
1. **Prepare** (`rake release:prepare`): Create a new branch to prepare the release, update the changelog, and bump the version
|
92
|
+
2. **Stage** (`rake release:stage`): Update the staging branch and create a PR to production
|
93
|
+
3. **Release** (`rake release`): Release the current version to production by tagging and pushing to the production branch
|
56
94
|
|
57
95
|
## Contributing
|
58
96
|
|
@@ -71,4 +109,5 @@ Releases are automated via GitHub Actions:
|
|
71
109
|
Bug reports and pull requests are welcome on GitHub.
|
72
110
|
|
73
111
|
## License
|
112
|
+
|
74
113
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
data/lib/discharger/task.rb
CHANGED
@@ -16,6 +16,8 @@ module Discharger
|
|
16
16
|
reissue.updated_paths = task.updated_paths
|
17
17
|
reissue.commit = task.commit
|
18
18
|
reissue.commit_finalize = task.commit_finalize
|
19
|
+
reissue.fragment_directory = task.fragment_directory
|
20
|
+
reissue.clear_fragments = task.clear_fragments
|
19
21
|
end
|
20
22
|
task.define
|
21
23
|
task
|
@@ -36,6 +38,8 @@ module Discharger
|
|
36
38
|
attr_accessor :app_name
|
37
39
|
attr_accessor :commit_identifier
|
38
40
|
attr_accessor :pull_request_url
|
41
|
+
attr_accessor :fragment_directory
|
42
|
+
attr_accessor :clear_fragments
|
39
43
|
|
40
44
|
attr_reader :last_message_ts
|
41
45
|
|
@@ -53,6 +57,7 @@ module Discharger
|
|
53
57
|
@staging_branch = "stage"
|
54
58
|
@production_branch = "main"
|
55
59
|
@description = "Release the current version to #{staging_branch}"
|
60
|
+
@clear_fragments = true
|
56
61
|
end
|
57
62
|
private attr_reader :tasker
|
58
63
|
|
data/lib/discharger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discharger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
@@ -101,6 +101,7 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- CHANGELOG.md
|
104
105
|
- LICENSE
|
105
106
|
- README.md
|
106
107
|
- Rakefile
|