From bf87d142f2643e05c4c5564ad6eb732e8331cef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 28 May 2025 14:36:47 -1000 Subject: [PATCH 1/4] Deduplicate where we get the version from Only keep a single copy of the version string to avoid forgetting to update it in one place when we bump it. --- puppet.gemspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/puppet.gemspec b/puppet.gemspec index 589c70c36a..e5cab869d1 100644 --- a/puppet.gemspec +++ b/puppet.gemspec @@ -1,6 +1,8 @@ +require_relative 'lib/puppet/version' + Gem::Specification.new do |spec| spec.name = "openvox" - spec.version = "8.18.1" + spec.version = Puppet::PUPPETVERSION spec.licenses = ['Apache-2.0'] spec.required_rubygems_version = Gem::Requirement.new("> 1.3.1") From 1ed72842b34f821000af55b9b095d871dd9d3052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 28 May 2025 14:38:25 -1000 Subject: [PATCH 2/4] Implement github-changelog-generator to generate CHANGELOG.md In the Vox Pupuli tradition, use labels in GitHub issues to generate a human readable changelog when we release a new version of the code. --- Gemfile | 1 + Rakefile | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Gemfile b/Gemfile index d3731d964a..2657da4ac7 100644 --- a/Gemfile +++ b/Gemfile @@ -69,6 +69,7 @@ group(:development, optional: true) do end group(:packaging) do + gem 'github_changelog_generator' gem 'packaging', *location_for(ENV['PACKAGING_LOCATION'] || '~> 0.99') end diff --git a/Rakefile b/Rakefile index 0ae403934a..3629ff6a3c 100644 --- a/Rakefile +++ b/Rakefile @@ -146,3 +146,19 @@ if Rake.application.top_level_tasks.grep(/^gettext:/).any? abort("Run `bundle install --with documentation` to install the `gettext-setup` gem.") end end + +require "github_changelog_generator/task" +require_relative "lib/puppet/version" + +GitHubChangelogGenerator::RakeTask.new :changelog do |config| + config.header = <<~HEADER.chomp + # Changelog + + All notable changes to this project will be documented in this file. + HEADER + config.user = "openvoxproject" + config.project = "puppet" + config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog] + config.since_tag = "8.18.1" + config.future_release = Puppet::PUPPETVERSION +end From b1e2ea09df739f2fb3a8180563f403048fb7a2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 28 May 2025 16:10:41 -1000 Subject: [PATCH 3/4] Add a dummy changelog rake task when the bundle is not complete Some parts of CI run with a bundle without the packaging gems, we should not raise an error if the github_changelog_generator gem is not found, but rather tell how to fix that when the task is called. --- Rakefile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Rakefile b/Rakefile index 3629ff6a3c..a325685e9f 100644 --- a/Rakefile +++ b/Rakefile @@ -147,18 +147,24 @@ if Rake.application.top_level_tasks.grep(/^gettext:/).any? end end -require "github_changelog_generator/task" -require_relative "lib/puppet/version" +begin + require "github_changelog_generator/task" + require_relative "lib/puppet/version" -GitHubChangelogGenerator::RakeTask.new :changelog do |config| - config.header = <<~HEADER.chomp + GitHubChangelogGenerator::RakeTask.new :changelog do |config| + config.header = <<~HEADER.chomp # Changelog All notable changes to this project will be documented in this file. - HEADER - config.user = "openvoxproject" - config.project = "puppet" - config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog] - config.since_tag = "8.18.1" - config.future_release = Puppet::PUPPETVERSION + HEADER + config.user = "openvoxproject" + config.project = "puppet" + config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog] + config.since_tag = "8.18.1" + config.future_release = Puppet::PUPPETVERSION + end +rescue LoadError + task :changelog do + abort("Run `bundle install --with packaging` to install the `github_changelog_generator` gem.") + end end From 5890be87fd413c8b8be19f7cf92431510ee953ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 29 May 2025 11:24:09 -1000 Subject: [PATCH 4/4] Create a release page on tag push, attach the gem to the release --- .github/workflows/release.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e16aa23afa..7ce460f03e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,3 +29,13 @@ jobs: chmod 0600 ~/.gem/credentials - name: Publish gem to GitHub packages run: gem push --key github --host https://rubygems.pkg.github.com/openvoxproject *.gem + - name: Create Release Page + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: gh release create ${{ github.ref_name }} --generate-notes + - name: Attach gem to GitHub Release + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload ${{ github.ref_name }} pkg/*.gem