Reusable workflows for:
- Merge requests android / ios libs.
- Publication to trunk for ios libs.
- Publication to maven central for android aar libs.
Via ./gradlew check
, which included detekt, tests, lint.
Add to repository .github/workflows/merge_request.yml
name: merge request
on:
pull_request:
branches:
- 'main'
jobs:
check:
uses: tinkoff-mobile-tech/workflows/.github/workflows/android_lib.merge_request.yml@v1
- Tag was pushed by developer.
- The version from the source is picked up (by default from the gradle.propeties file at the root of the project).
- Check if the same tag exists.
- Published on maven Central https://mvnrepository.com/artifact/ru.tinkoff
- A release will be created on github
- The tag with the version number will push.
- Go to "actions".
- Select "Publish" on the left column with workflows.
- Click on the green button "Run workflow".
! You should increment the version by yourself in the repository.
- Add gradle plugin "maven" task
uploadArchive
Example commit with a file. or plugin "maven-publish" with taskpublishReleasePublicationToMavenRepository
- Add to repository
.github/workflows/publish.yml
name: publish
on:
workflow_dispatch:
jobs:
publish:
uses: tinkoff-mobile-tech/workflows/.github/workflows/android_lib.publish.yml@v1
secrets:
gpg_key: ${{ secrets.GPG_KEY }}
sign_ossrh_gradle_properties: ${{ secrets.SIGN_OSSRH_GRADLE_PROPERTIES }}
required secret environments:
- gpg_key - is base64 gpgkey. Example how to get it
base64 -i cert.der -o cert.base64
- sign_ossrh_gradle_properties - file with gradle secret properties:
signing.keyId=
signing.password=
ossrhUsername=oss username
ossrhPassword=oss pass
jobs:
check:
uses: tinkoff-mobile-tech/workflows/.github/workflows/android_lib.merge_request.yml@v1
with:
java_version: '8'
by default java is 11
./Gemfile
in the root repository:
source "https://rubygems.org"
gem "cocoapods", "~> 1.11.3"
gem 'fastlane', '~> 2.204.3'
gem 'fastlane-plugin-changelog'
gem 'rubocop', '~> 0.93.1' # if exists
gem 'rubocop-require_tools'
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
2fastlane/Fastfile
import_from_git(
url: "https://github.com/tinkoff-mobile-tech/workflows.git",
path: "fastlane/Fastfile"
)
Add to repository .github/workflows/merge_request.yml
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"
use with xcodeproj_path
and scheme_name
only for spm built libs, for other options you don't have to.
it calls lint_fastfile
, pod_lib_lint
, swift package generate-xcodeproj
, xcodebuild clean build
.
- Runs lint and other checks.
- The version is bumped in *.podspec files.
- The changelog is being changed.
- Pushed to cocaopods trunk repository.
- The tag will push with the version number and modified *.podspec files.
- The release card will be created in github.
- Go to "actions".
- Select "Publish" on the left column with workflows.
- Click on the green button "Run workflow".
- Type which type of version have to bump - patch / minor / major.
For publishing to work, secrets must be added to the project or organization: COCOAPODS_TRUNK_TOKEN
- How to get COCOAPODS_TRUNK_TOKEN - https://github.com/marketplace/actions/deploy-to-cocoapod-action
- How trunk publishing works - https://guides.cocoapods.org/making/making-a-cocoapod.html.
Add to repository .github/workflows/publish.yml
name: publish
on:
workflow_dispatch:
inputs:
bump_type:
required: true
type: string
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: ${{ github.event.inputs.bump_type }}
secrets:
cocapods_trunk_token: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
Override lane extend_bump_version
. Add to fastlane/Fastfile
.
override_lane :extend_bump_version do |options|
version_swift="TinkoffASDKCore/TinkoffASDKCore/Version.swift"
relative_file_path = "../" + version_swift
data = File.read(relative_file_path)
data = data.gsub(/versionString = \"([\d.]+)\"/, "versionString = \"#{options[:version]}\"")
File.write(relative_file_path, data)
[version_swift]
end