mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Improve release process
- remove towncrier logs from PR builds and move them to github releases - set build version based on current time - bump app version
This commit is contained in:
committed by
Stefan Ceriu
parent
5fa541ffb7
commit
2f69c99782
@@ -81,18 +81,10 @@ jobs:
|
|||||||
DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }}
|
DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }}
|
||||||
GITHUB_PR_NUMBER: ${{ github.event.number }}
|
GITHUB_PR_NUMBER: ${{ github.event.number }}
|
||||||
|
|
||||||
- name: Read version_changes.md
|
|
||||||
id: read_changes
|
|
||||||
uses: juliangruber/read-file-action@v1
|
|
||||||
with:
|
|
||||||
path: ./version_changes.md
|
|
||||||
|
|
||||||
- name: Add release notes and Diawi info
|
- name: Add release notes and Diawi info
|
||||||
uses: NejcZdovc/comment-pr@v1
|
uses: NejcZdovc/comment-pr@v1
|
||||||
with:
|
with:
|
||||||
message: |
|
message: |
|
||||||
${{ steps.read_changes.outputs.content }}
|
|
||||||
|
|
||||||
:iphone: Scan the QR code below to install the build for this PR.
|
:iphone: Scan the QR code below to install the build for this PR.
|
||||||
:lock: This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.
|
:lock: This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.
|
||||||
|
|
||||||
|
|||||||
@@ -2367,7 +2367,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.1;
|
MARKETING_VERSION = 1.0.2;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx;
|
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx;
|
||||||
PRODUCT_NAME = ElementX;
|
PRODUCT_NAME = ElementX;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
@@ -2389,7 +2389,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.1;
|
MARKETING_VERSION = 1.0.2;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx;
|
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx;
|
||||||
PRODUCT_NAME = ElementX;
|
PRODUCT_NAME = ElementX;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ targets:
|
|||||||
base:
|
base:
|
||||||
PRODUCT_NAME: ElementX
|
PRODUCT_NAME: ElementX
|
||||||
PRODUCT_BUNDLE_IDENTIFIER: io.element.elementx
|
PRODUCT_BUNDLE_IDENTIFIER: io.element.elementx
|
||||||
MARKETING_VERSION: 1.0.1
|
MARKETING_VERSION: 1.0.2
|
||||||
CURRENT_PROJECT_VERSION: 1
|
CURRENT_PROJECT_VERSION: 1
|
||||||
DEVELOPMENT_TEAM: 7J4U792NQT
|
DEVELOPMENT_TEAM: 7J4U792NQT
|
||||||
CODE_SIGN_ENTITLEMENTS: ElementX/SupportingFiles/ElementX.entitlements
|
CODE_SIGN_ENTITLEMENTS: ElementX/SupportingFiles/ElementX.entitlements
|
||||||
|
|||||||
+17
-13
@@ -42,8 +42,6 @@ lane :alpha do
|
|||||||
|
|
||||||
upload_to_diawi()
|
upload_to_diawi()
|
||||||
|
|
||||||
export_version_changes(version: version)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
lane :build_and_publish_on_github do
|
lane :build_and_publish_on_github do
|
||||||
@@ -99,13 +97,6 @@ lane :tests do
|
|||||||
|
|
||||||
end
|
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: {})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private_lane :config_xcodegen_alpha do
|
private_lane :config_xcodegen_alpha do
|
||||||
target_file_path = "../ElementX/SupportingFiles/target.yml"
|
target_file_path = "../ElementX/SupportingFiles/target.yml"
|
||||||
data = YAML.load_file target_file_path
|
data = YAML.load_file target_file_path
|
||||||
@@ -151,20 +142,33 @@ private_lane :release_to_github do
|
|||||||
diawi_app_id = URI(diawi_link).path.split('/').last
|
diawi_app_id = URI(diawi_link).path.split('/').last
|
||||||
diawi_qr_code_link = "https://www.diawi.com/qrcode/link/#{diawi_app_id}"
|
diawi_qr_code_link = "https://www.diawi.com/qrcode/link/#{diawi_app_id}"
|
||||||
|
|
||||||
release_version = "#{get_version_number()}-#{Time.now.strftime("%Y%m%d%H%M")}"
|
# Increment build number to current date
|
||||||
|
build_number = Time.now.strftime("%Y%m%d%H%M")
|
||||||
|
increment_build_number(build_number: build_number)
|
||||||
|
|
||||||
|
release_version = get_version_number()
|
||||||
|
|
||||||
|
changes = export_version_changes(version: release_version)
|
||||||
|
|
||||||
github_release = set_github_release(
|
github_release = set_github_release(
|
||||||
repository_name: "vector-im/element-x-ios",
|
repository_name: "vector-im/element-x-ios",
|
||||||
api_token: api_token,
|
api_token: api_token,
|
||||||
name: release_version,
|
name: release_version,
|
||||||
tag_name: release_version,
|
tag_name: release_version,
|
||||||
is_generate_release_notes: true,
|
is_generate_release_notes: false,
|
||||||
description: "[iOS AdHoc Release - Diawi Link](#{diawi_link})
|
description: "[iOS AdHoc Release - Diawi Link](#{diawi_link})
|
||||||
",
|

|
||||||
# upload_assets: ["build/ElementX.app.zip"]
|
#{changes}"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_lane :export_version_changes do |options|
|
||||||
|
Dir.chdir("..") do
|
||||||
|
# Changelog.update_topmost_section(version: options[:version], additional_entries: {})
|
||||||
|
Changelog.extract_first_section
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private_lane :update_app_icon do |options|
|
private_lane :update_app_icon do |options|
|
||||||
caption_text = options[:caption_text]
|
caption_text = options[:caption_text]
|
||||||
UI.user_error!("Invalid caption text.") unless !caption_text.to_s.empty?
|
UI.user_error!("Invalid caption text.") unless !caption_text.to_s.empty?
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ require "date"
|
|||||||
# Helper methods to handle updates of the Changelog file
|
# Helper methods to handle updates of the Changelog file
|
||||||
#
|
#
|
||||||
module Changelog
|
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
|
# Update the topmost section of the changelog to put version+date in title + add entry for dependency updates
|
||||||
#
|
#
|
||||||
@@ -40,5 +42,22 @@ module Changelog
|
|||||||
# Let towncrier update the change
|
# Let towncrier update the change
|
||||||
system("towncrier", "build", "--version", "#{version}", "--yes")
|
system("towncrier", "build", "--version", "#{version}", "--yes")
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user