update_files.rb 1.2 KB

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. if !Gem::Version.correct?(ARGV[0])
  3. puts 'Usage: update_files.rb new.semantic.version'
  4. exit 1
  5. end
  6. # New version
  7. new_version = ARGV[0].chomp
  8. (new_version_major, new_version_minor) = new_version.split('.')
  9. # Previous stable version
  10. previous_stable_version = `git tag | grep -v "-" | tail -n1`.chomp
  11. # Write VERSION
  12. Rails.root.join('VERSION').write("#{new_version}\n")
  13. # Write CHANGELOG.md
  14. changelog = <<~CHANGELOG
  15. # Change Log for Zammad #{new_version}
  16. - [Release notes](https://zammad.com/en/releases/#{new_version.tr('.', '-').sub(%r{-0$}, '')})
  17. - [Implemented enhancements](https://github.com/zammad/zammad/issues?q=is%3Aclosed+milestone%3A#{new_version_major}.#{new_version_minor}+(-type%3ABug+AND+-label%3Abug))
  18. - [Closed bugs](https://github.com/zammad/zammad/issues?q=is%3Aclosed+milestone%3A#{new_version_major}.#{new_version_minor}+(type%3ABug+OR+label%3Abug))
  19. - [Full commit log](https://github.com/zammad/zammad/compare/#{previous_stable_version}...#{new_version})
  20. - [File tree](https://github.com/zammad/zammad/tree/#{new_version})
  21. CHANGELOG
  22. Rails.root.join('CHANGELOG.md').write(changelog)