Skip to content

Commit

Permalink
Merge pull request #308 from betadots/update_howto_release
Browse files Browse the repository at this point in the history
Update Release Howto
  • Loading branch information
rwaffen authored Feb 21, 2024
2 parents 1473bab + 6c4909a commit c112b2b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
24 changes: 11 additions & 13 deletions RELEASE_howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,34 @@ bundle install

## Create Release PR

```shell
export CHANGELOG_GITHUB_TOKEN="github_TOKEN"
git switch -c release/X.Y.Z
```

edit `Rakefile`, search replace `future_release`
Please follow these instructions carefully. Ensure that you name the branch precisely as `release-vX.Y.Z` since this nomenclature is crucial for obtaining the future_version in the changelog. Your attention to this specific branch naming convention is essential for accurate version tracking in the changelog.

```text
config.future_release = 'X.Y.Z'
```shell
git switch -c release-vX.Y.Z
```

Create Changelog

```shell
export CHANGELOG_GITHUB_TOKEN="github_TOKEN"
bundle exec rake changelog
```

check generated changlog
Check generated `CHANGELOG.md`

Create release pull request
Add and push changes to create a release PR

```shell
git add -A
git commit -m 'Release vX.Y.Z'
git push
git push origin release-vX.Y.Z
```

Open pull request on GitHub, add `skip-changelog` label and merge
Open pull request on GitHub, add `skip-changelog` label, discuss and merge

## Create release tag

## Set release tag
After the release PR is merged

```shell
git switch main
Expand Down
15 changes: 8 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ begin
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix modulesync skip-changelog]
config.user = 'betadots'
config.project = 'hdm'
config.future_release = '1.4.1'
# get branch name from git and strip off any prefixes (e.g. 'release-')
config.future_release = `git rev-parse --abbrev-ref HEAD`.strip.split('-', 2).last
end

# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /linux/
task :changelog do
if RbConfig::CONFIG['host_os'].include?('linux')
task changelog: :environment do
puts 'Fixing line endings...'
changelog_file = File.join(__dir__, 'CHANGELOG.md')
changelog_txt = File.read(changelog_file)
new_contents = changelog_txt.gsub(%r{\r\n}, "\n")
File.open(changelog_file, "w") {|file| file.puts new_contents }
new_contents = changelog_txt.gsub("\r\n", "\n")
File.open(changelog_file, "w") { |file| file.puts new_contents }
end
end

rescue LoadError
# github_changelog_generator isn't available, so we won't define a rake task with it
end

0 comments on commit c112b2b

Please sign in to comment.