-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from tinkoff-mobile-tech/add_workflow
Add workflow
- Loading branch information
Showing
7 changed files
with
115 additions
and
91 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: merge request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
check: | ||
uses: tinkoff-mobile-tech/workflows/.github/workflows/ios_lib.merge_request.yml@v1 | ||
with: | ||
xcodeproj_path: "TinkoffID.xcodeproj" | ||
scheme_name: "TinkoffID-Package" |
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,19 @@ | ||
name: publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
bump_type: | ||
required: true | ||
type: string | ||
description: "bump type for version" | ||
|
||
jobs: | ||
publish: | ||
uses: tinkoff-mobile-tech/workflows/.github/workflows/ios_lib.publish.yml@v1 | ||
with: | ||
xcodeproj_path: "TinkoffID.xcodeproj" | ||
scheme_name: "TinkoffID-Package" | ||
bump_type: ${{ inputs.bump_type }} | ||
secrets: | ||
cocapods_trunk_token: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |
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,73 @@ | ||
warning_threshold: 1 | ||
|
||
excluded: | ||
- Pods | ||
- /**/Generated | ||
|
||
disabled_rules: | ||
# У линий не должно пыть просбелов справа от текста | ||
- trailing_whitespace | ||
- class_delegate_protocol | ||
# Делегаты должны быть weak, чтобы избежать цикла сильных ссылок | ||
- weak_delegate | ||
# Сложность тела функции должна быть ограничена | ||
- cyclomatic_complexity | ||
# Функции не должны быть слишком длинными | ||
- function_body_length | ||
# Файлы не должны быть слишком длинными | ||
#- file_length | ||
# ToDo remove below and fix violations! | ||
- missing_docs | ||
- legacy_random | ||
- unused_closure_parameter | ||
- colon | ||
- force_try | ||
- force_cast | ||
- overridden_super_call | ||
- vertical_whitespace | ||
- leading_whitespace | ||
- line_length | ||
- operator_usage_whitespace | ||
- trailing_comma | ||
- trailing_newline | ||
opt_in_rules: | ||
# Некоторые переопределяемые методы всегда должны вызывать super | ||
- overridden_super_call | ||
# Некоторые методы не должны вызывать super | ||
- prohibited_super_call | ||
# Избегаем непосредственного вызова .init() | ||
- explicit_init | ||
# Операторы должны быть окружены одиночным пробелом | ||
- operator_usage_whitespace | ||
# Публичные методы/классы/.. должны быть документированы | ||
- missing_docs | ||
|
||
|
||
large_tuple: 4 | ||
|
||
line_length: 150 | ||
|
||
function_parameter_count: | ||
warning: 10 | ||
error: 15 | ||
|
||
file_length: | ||
warning: 500 | ||
|
||
type_body_length: | ||
warning: 400 | ||
error: 450 | ||
|
||
nesting: | ||
type_level: | ||
warning: 3 | ||
statement_level: | ||
warning: 5 | ||
|
||
identifier_name: | ||
min_length: 1 | ||
max_length: 65 | ||
|
||
type_name: | ||
min_length: 3 | ||
max_length: 65 |
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 |
---|---|---|
@@ -1,86 +1,4 @@ | ||
lane :release do |options| | ||
# Checking bump type | ||
bump_type = resolve_bump_type(options) | ||
|
||
# Checking that everything is alright | ||
checkup | ||
|
||
# Checking git | ||
ensure_git_status_clean | ||
ensure_git_branch(branch: "master") | ||
|
||
# Bumping podspec version | ||
version = version_bump_podspec(bump_type: bump_type) | ||
|
||
# Stamping changelog | ||
stamp_changelog(section_identifier: version) | ||
|
||
# Creating release commit and tag | ||
git_commit(path: "CHANGELOG.md", message: "Release #{version}") | ||
add_git_tag(tag: version) | ||
|
||
# Pushing to remote repo | ||
push_to_git_remote(tags: true) | ||
|
||
# Pushing podspec to Cocoapods repo | ||
push_podspec | ||
end | ||
|
||
lane :checkup do | ||
# Linting ruby files | ||
lint_fastfile | ||
|
||
# Linting podspec | ||
pod_lib_lint(allow_warnings: true) | ||
|
||
# Buidling Swift package | ||
build_swift_package | ||
end | ||
|
||
lane :build_swift_package do | ||
project_name = "TinkoffID.xcodeproj" | ||
scheme_name = "TinkoffID-Package" | ||
config_file_name = "Config.xcconfig" | ||
|
||
# Creating configuration file | ||
sh("echo SWIFT_ACTIVE_COMPILATION_CONDITIONS=''> #{config_file_name}") | ||
|
||
# Generating xcode project | ||
sh("swift package generate-xcodeproj --xcconfig-overrides #{config_file_name}") | ||
|
||
# Building generated xcode project | ||
sh("xcodebuild clean build -project ../#{project_name} -sdk iphoneos -scheme '#{scheme_name}'") | ||
|
||
# Cleaning up | ||
sh("rm -f #{config_file_name}") | ||
sh("rm -rf ../#{project_name}") | ||
end | ||
|
||
lane :lint_fastfile do | ||
Dir.chdir("..") do | ||
error_callback = lambda do |result| | ||
UI.user_error!("rubocop execution failed: #{result}") | ||
end | ||
|
||
sh('bundle exec rubocop -c .rubocop.yml', error_callback: error_callback) | ||
end | ||
end | ||
|
||
lane :push_podspec do | ||
podspec_name = "TinkoffID.podspec" | ||
|
||
pod_push( | ||
path: podspec_name, | ||
allow_warnings: true, | ||
skip_tests: true | ||
) | ||
end | ||
|
||
def resolve_bump_type(options) | ||
valid_bump_types = ['patch', 'minor', 'major'] | ||
bump_type = valid_bump_types.include?(options[:type]) ? options[:type] : nil | ||
|
||
UI.abort_with_message!("Bump type is not specified or incorrect! You can use `type: #{valid_bump_types.join('/')}` to specify it.") unless bump_type | ||
|
||
return bump_type | ||
end | ||
import_from_git( | ||
url: "https://github.com/tinkoff-mobile-tech/workflows.git", # The URL of the repository to import the Fastfile from. | ||
path: "fastlane/Fastfile" # The path of the Fastfile in the repository. | ||
) |
This file was deleted.
Oops, something went wrong.