Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Release Howto #308

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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