Skip to content

Instantly share code, notes, and snippets.

View mariia-cherniuk's full-sized avatar

Mariia Cherniuk mariia-cherniuk

  • London, United Kingdom
View GitHub Profile
desc "Publish jira release"
lane :publish_jira_release do
Actions.sh("git remote set-url origin [email protected]:your_app_git_url")
git_checkout(remote_branch: ENV['MASTER_BRANCH'])
git_pull
version_number = ENV['MPG_VERSION_NUMBER'].to_s.empty? ? get_version_number : ENV['MPG_VERSION_NUMBER']
publish_jira_version_release(version: version_number)
end
desc "Closes tickets and publish a \"Jira\" release"
publish-jira-release:
only:
refs:
- develop
needs: [submit-appstore]
stage: publish-artifacts
tags: [osx]
allow_failure: false
script:
- bundle exec fastlane publish_jira_release
deploy-testflight:
only:
refs:
- develop
stage: deploy-testflight
tags: [osx]
script:
- bundle exec fastlane testflight_beta
desc "Submits a new beta build to \"Apple TestFlight\""
lane :testflight_beta do
build(profile_type: "appstore", scheme: "TestFlight", app_identifier: "your_app_identifier")
pilot(skip_waiting_for_build_processing: true)
end
deploy-testflight-pr:
only:
- external_pull_requests
stage: deploy-testflight-pr
needs: [ui-regression]
stage: deploy-testflight-pr
tags: [osx]
when: manual
script:
- bundle exec fastlane testflight_beta
desc "Runs all the regression UI Tests"
lane :regression do
scan(scheme: "UAT Regression", skip_build: true)
end
desc "Runs pull request workflow \"Open a pull request\""
lane :pull_request do
scan(scheme: "Pull Request", skip_build: true)
end
unit-tests:
only:
- external_pull_requests
stage: unit-tests
tags: [osx]
script:
- bundle exec fastlane pull_request
artifacts:
when: always
paths:
desc "Create and checkout git branch for a JIRA ticket"
lane :checkout do |options|
ticket = options[:ticket]
if !ticket
ticket = prompt(text: "JIRA ticket key e.g. AMI-XYZ: ")
end
checkout_branch_for_jira_issue(key: ticket)
end
desc "Merges develop into your feature branch \"Pre-push git hook\""
lane :merge_develop_if_needed do
current_branch = Actions.sh("git rev-parse --abbrev-ref HEAD")
next unless current_branch.start_with?(ENV['JIRA_PROJECT'])
Actions.sh("git fetch && git merge origin/#{ENV['DEVELOP_BRANCH']} --no-edit")
end