mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 13:37:11 +00:00
Towncrier fixes (#97)
This commit is contained in:
parent
36c34503fc
commit
cc14f1f567
2
.gitignore
vendored
2
.gitignore
vendored
@ -29,6 +29,8 @@ fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots/**/*.png
|
||||
fastlane/test_output
|
||||
towncrier.toml.tmp
|
||||
version_changes.md
|
||||
|
||||
build
|
||||
Tools/Scripts/element-android
|
||||
|
1
changelog.d/96.misc
Normal file
1
changelog.d/96.misc
Normal file
@ -0,0 +1 @@
|
||||
Fix project urls in Towncrier configuration.
|
@ -1,7 +1,6 @@
|
||||
{# iOS Repositories #}
|
||||
{%- set gh_sdk = "https://github.com/matrix-org/matrix-ios-sdk" -%}
|
||||
{%- set gh_kit = "https://github.com/matrix-org/matrix-ios-kit" -%}
|
||||
{%- set gh_element = "https://github.com/vector-im/element-ios" -%}
|
||||
{%- set gh_sdk = "https://github.com/matrix-org/matrix-rust-sdk" -%}
|
||||
{%- set gh_element = "https://github.com/vector-im/element-x-ios" -%}
|
||||
|
||||
## {{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }})
|
||||
{% for section, _ in sections.items() %}
|
||||
@ -18,9 +17,6 @@
|
||||
{%- if value.startswith("sdk-") %}
|
||||
{%- set gh_issue = value.replace("sdk-", "") -%}
|
||||
{{- links.append( "[#%s](%s/issues/%s)" | format(gh_issue, gh_sdk, gh_issue) ) | default("", True) -}}
|
||||
{%- elif value.startswith("kit-") %}
|
||||
{%- set gh_issue = value.replace("kit-", "") -%}
|
||||
{{- links.append( "[#%s](%s/issues/%s)" | format(gh_issue, gh_kit, gh_issue) ) | default("", True) -}}
|
||||
{%- elif value.startswith("#") %}
|
||||
{%- set gh_issue = value.replace("#", "") -%}
|
||||
{{- links.append( "[#%s](%s/issues/%s)" | format(gh_issue, gh_element, gh_issue) ) | default("", True) -}}
|
||||
|
@ -101,13 +101,8 @@ end
|
||||
|
||||
private_lane :export_version_changes do |options|
|
||||
Dir.chdir("..") do
|
||||
sh("sed -i '.tmp' 's/CHANGES.md/version_changes.md/g' towncrier.toml")
|
||||
Changelog.update_topmost_section(version: options[:version], additional_entries: {})
|
||||
changelog = Changelog.extract_first_section
|
||||
|
||||
# Pushing them directly into the $GITHUB_ENV results in errors
|
||||
# https://trstringer.com/github-actions-multiline-strings/
|
||||
# String substitution and here documents failed too
|
||||
sh("echo '#{changelog}' >> version_changes.md")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -11,9 +11,7 @@ require "date"
|
||||
# Helper methods to handle updates of the Changelog file
|
||||
#
|
||||
module Changelog
|
||||
CHANGES_SEPARATOR_REGEX = /^\#\#\ Changes/.freeze
|
||||
FILE = "CHANGES.md"
|
||||
|
||||
|
||||
# Update the topmost section of the changelog to put version+date in title + add entry for dependency updates
|
||||
#
|
||||
# @param [String] version The version that we are releasing to use in the new title of the first section
|
||||
@ -43,21 +41,4 @@ module Changelog
|
||||
system("towncrier", "build", "--version", "#{version}", "--yes")
|
||||
end
|
||||
|
||||
# Returns the first section of the Changelog, corresponding to the changes in the latest version
|
||||
#
|
||||
def self.extract_first_section
|
||||
lines = []
|
||||
File.open(FILE, "r") do |file|
|
||||
section_index = 0
|
||||
file.each_line do |line|
|
||||
is_separator_line = (line.chomp =~ CHANGES_SEPARATOR_REGEX)
|
||||
section_index += 1 if is_separator_line
|
||||
break if section_index >= 2
|
||||
|
||||
lines.append(line) if section_index == 1
|
||||
end
|
||||
end
|
||||
lines[0..-2].join # Remove last line (title of section 2)
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user