Skip to content

Commit

Permalink
Extract only the current release notes for the chart content
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Dec 6, 2023
1 parent 863e2f6 commit 8191e1f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
sign: true
# UID of the GPG key to use
key: "[email protected]"
release-notes-file: CHANGELOG.md
release-notes-file: RELEASE-NOTES.md
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ jobs:
- name: Prepare for publish
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
cp -f CHANGELOG.md charts/openproject/CHANGELOG.md
ruby script/extract-changeset
- name: Publish
if: steps.changesets.outputs.hasChangesets == 'false'
uses: helm/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
charts/openproject/charts
charts/openproject/RELEASE-NOTES.md
Chart.lock
node_modules/
.cr-gpg/
17 changes: 17 additions & 0 deletions script/extract-changeset
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env ruby
require 'json'
require 'yaml'

changelog_file = File.expand_path('../CHANGELOG.md', __dir__)
changelog = File.read changelog_file

chart_file = File.expand_path('../charts/openproject/RELEASE-NOTES.md', __dir__)
release_notes = changelog.split(/^## \d+\.\d+\.\d+$/)[1]

puts "Writing to #{chart_file}:"
puts release_notes

File.open(chart_file, 'w') do |f|
f.write release_notes
end

0 comments on commit 8191e1f

Please sign in to comment.