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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23bf801a204e17e5f37876fba770bc9610814b629ee570924c04414547bc801b
4
- data.tar.gz: 594b4fceeb396a77ada63a549eee831d72ea6b1c942ff1a1ac813cea877e6c56
3
+ metadata.gz: 9ce45e28ffd20d694eec7075403138701e726efbaef6f5b5000e51c34eca3961
4
+ data.tar.gz: f378cf858c863d47255ea695ed95daf676c7943ea1ac7d5f4f2044cb04604d17
5
5
  SHA512:
6
- metadata.gz: ec6dadb8198acd18144256694bcfdd0cd7c58275e6ad8f2ed6d9bc374633db99e6bf50278fb137a7675af74759e9ecc885dc8450852e2561655b0d5ba6e2cf75
7
- data.tar.gz: fcf463c7d4e9721b4a94a470a6ee0b75673888cf0f0c9e87fa998f208e0a3a1a88d8338de4add5ae1205f1a643e0ae49b59f814bf28854c5cd78bb5a09b96b0e
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
- ## Usage
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
- Add `require "discharger/task"` to your Rakefile.
23
+ Or install it yourself as:
24
+ ```bash
25
+ $ gem install discharger
26
+ ```
7
27
 
8
- Then build the discharger task
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
- task.app_name = "My App name"
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
- It will make Rake tasks available to push code to branches and notify Slack channels.
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
- ## Installation
36
- Add this line to your application's Gemfile:
89
+ ### Workflow Steps
37
90
 
38
- ```ruby
39
- gem "discharger"
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
@@ -10,6 +10,7 @@ Reissue::Task.create :reissue do |task|
10
10
  task.commit = !ENV["GITHUB_ACTIONS"]
11
11
  task.commit_finalize = !ENV["GITHUB_ACTIONS"]
12
12
  task.push_finalize = :branch
13
+ task.clear_fragments = true
13
14
  end
14
15
 
15
16
  Rake::TestTask.new(:test) do |t|
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Discharger
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.13"
3
3
  end
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.11
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