forked from onevcat/Kingfisher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
143 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,3 +76,4 @@ fastlane/screenshots/screenshots.html | |
# scan temporary files | ||
fastlane/test_output | ||
test_output | ||
fastlane/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module Fastlane | ||
module Actions | ||
class ExtractCurrentChangeLogAction < Action | ||
require 'yaml' | ||
def self.run(params) | ||
yaml = File.read(params[:file]) | ||
data = YAML.load(yaml) | ||
version = data["version"] | ||
raise "The version should match in the input file".red unless (version and version == params[:version]) | ||
|
||
title = "#{version}" | ||
title = title + " - #{data["name"]}" if (data["name"] and not data["name"].empty?) | ||
|
||
return {:title => title, :version => version, :add => data["add"], :fix => data["fix"]} | ||
end | ||
|
||
##################################################### | ||
# @!group Documentation | ||
##################################################### | ||
|
||
def self.description | ||
"Extract change log information for a specified version." | ||
end | ||
|
||
def self.details | ||
"This action will check input version and change log. If everything goes well, the change log info will be returned." | ||
end | ||
|
||
def self.available_options | ||
[ | ||
FastlaneCore::ConfigItem.new(key: :version, | ||
env_name: "KF_EXTRACT_CURRENT_CHANGE_LOG_VERSION", | ||
description: "The target version which is needed to be extract", | ||
verify_block: proc do |value| | ||
raise "No version number is given, pass using `version: 'version_number'`".red unless (value and not value.empty?) | ||
end), | ||
FastlaneCore::ConfigItem.new(key: :file, | ||
env_name: "KF_EXTRACT_CURRENT_CHANGE_LOG_PRECHANGE_FILE", | ||
description: "Create a development certificate instead of a distribution one", | ||
default_value: "pre-change.yml") | ||
] | ||
end | ||
|
||
def self.return_value | ||
"An object contains change log infomation. {version: }" | ||
end | ||
|
||
def self.is_supported?(platform) | ||
true | ||
end | ||
|
||
def self.authors | ||
["onevcat"] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module Fastlane | ||
module Actions | ||
class UpdateChangeLogAction < Action | ||
def self.run(params) | ||
log = params[:log] | ||
raise "Invalid log object".red unless !log[:title].empty? and !log[:version].empty? | ||
|
||
readme = File.read(params[:changelogfile]) | ||
log_text = "## [#{log[:title]}](https://github.com/onevcat/Kingfisher/releases/tag/#{log[:version]}) (#{Time.now.strftime("%Y-%m-%d")})\n\n" | ||
|
||
des = "" | ||
add = log[:add].map { |i| "* #{i}" }.join("\n") unless log[:add].nil? | ||
des = des + "#### Add\n#{add}\n\n" unless add.nil? or add.empty? | ||
|
||
fix = log[:fix].map { |i| "* #{i}" }.join("\n") unless log[:fix].nil? | ||
des = des + "#### Fix\n#{fix}\n\n" unless fix.nil? or fix.empty? | ||
|
||
log_text = log_text + des | ||
|
||
File.open(params[:changelogfile], 'w') { |file| file.write(readme.sub("-----", "-----\n\n#{log_text}---")) } | ||
|
||
return {:title => log[:title], :text => des} | ||
end | ||
|
||
##################################################### | ||
# @!group Documentation | ||
##################################################### | ||
|
||
def self.description | ||
"Update the change log file with the content of log" | ||
end | ||
|
||
def self.details | ||
"Generally speaking, the log is return value of extract_current_change_log action" | ||
end | ||
|
||
def self.available_options | ||
[ | ||
FastlaneCore::ConfigItem.new(key: :log, | ||
env_name: "KF_UPDATE_CHANGE_LOG_LOG", | ||
description: "Change log extracted by pre change log file", | ||
is_string: false | ||
), | ||
FastlaneCore::ConfigItem.new(key: :changelogfile, | ||
env_name: "KF_UPDATE_CHANGE_LOG_CHANGE_LOG_FILE", | ||
description: "The change log file, if not set, CHANGELOG.md will be used", | ||
default_value: "CHANGELOG.md") | ||
] | ||
end | ||
|
||
def self.authors | ||
["onevcat"] | ||
end | ||
|
||
def self.is_supported?(platform) | ||
true | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: 1.9.3 | ||
name: | ||
add: | ||
fix: | ||
- Stop indicator animation when loading failed. #215 |