diff --git a/RELEASE_howto.md b/RELEASE_howto.md index 321aac5f..c37eed82 100644 --- a/RELEASE_howto.md +++ b/RELEASE_howto.md @@ -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 diff --git a/Rakefile b/Rakefile index 7bd8813f..7ed8f85c 100644 --- a/Rakefile +++ b/Rakefile @@ -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