我有一个react-native应用程序,两者都有ios和android公共目录中的目录。我希望能够独立发布(执行一个车道) iOS或Android,所以我设置了fastlane init在每个平台目录中(创建了两个fastlane/Fastfile在每个平台目录中)。安卓Fastfile大致包含:
platform :android do
lane: release_android do
...
end和iOS:
platform :ios do
lane: release_ios do
...
end现在,我还手动创建了一个fastlane/Fastfile公共包含目录中的文件,如下所示:
import '../ios/fastlane/Fastfile'
import '../android/fastlane/Fastfile'
lane :release_all do
release_android
release_ios
end但是,当我运行fastlane release_all在主目录中,它与Could not find action or lane 'release_android'..。
你知道我哪里做错了吗?从普通通道调用特定于平台的通道是不可能的吗?
环境
快车道1.96.0
发布于 2016-10-18 05:22:59
这不是理想的解决方案,因为它最终会将您的通道执行包装在另一个通道中,但我们在您的等效release_all然而,我想知道它是否允许并行运行这些:
sh "fastlane ios beta"
sh "fastlane android beta"发布于 2021-02-27 11:46:31
如下所示:
package.json
packages/fastlane/
Fastfile
config.yml
apps/someapp/
package.json
ios/
android/
app/
App.tsx
App.test.tsx
fastlane/
Fastfile
config.ymlpackage.json
{
"name": "yourmonorepo",
"version": "0.0.1",
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"app:someapp": "yarn workspace @you/someapp",
...
}
}packages/fastlane/config.yml
codesigning:
git_url: git+ssh://git@your.vcs/reponame.git
branch: masterpackages/fastlane/Fastfile
fastlane_require 'config'
# this ends up always being `packages/fastlane`
HERE_DIR = File.expand_path(__dir__)
# different per app, but in the case of `someapp` it'll be `apps/someapp`
APP_ROOT = File.expand_path(File.dirname(Dir.pwd))
# the root of the repo, where your root package.json is
REPO_ROOT = File.expand_path('../..', __dir__)
STAGE_DEV = "development"
STAGE_PROD = "production"
Config.setup do |config|
config.use_env = true
config.env_prefix = 'YOU_FASTLANE'
config.env_separator = '__'
config.env_converter = :downcase
config.env_parse_values = true
end
Settings = Config.load_files(
"#{__dir__}/config.yml",
"#{Dir.pwd}/config.yml"
)
APPLICATION_ID = Settings.application.id
CRYPTEX_GITURL = Settings.codesigning.git_url
CRYPTEX_BRANCH = Settings.codesigning.branch
lane :setup do
Fastlane::LaneManager.cruise_lane(
'ios',
'keyfile_get',
{
'stage' => STAGE_DEV
}
)
Fastlane::LaneManager.cruise_lane(
'ios',
'keystore_get',
{
'stage' => STAGE_DEV
}
)
Fastlane::LaneManager.cruise_lane(
'android',
'keyfile_get',
{
'stage' => STAGE_DEV
}
)
Fastlane::LaneManager.cruise_lane(
'android',
'keystore_get',
{
'stage' => STAGE_DEV
}
)
end
platform :android do
lane :keystore_get do |options|
stage = options[:stage] || STAGE_DEV
UI.message("Fetched android #{stage} keystore from codesigning repo #{CRYPTEX_REPO}")
end
lane :keyfile_get do |options|
stage = options[:stage] || STAGE_DEV
UI.message("Fetched android #{stage} keyfile from codesigning repo #{CRYPTEX_REPO}")
end
lane :release_prod do
# do magic here
end
end
platform :ios do
lane :keystore_get do |options|
stage = options[:stage] || STAGE_DEV
UI.message("Fetched ios #{stage} keystore from codesigning repo #{CRYPTEX_REPO}")
end
lane :keyfile_get do |options|
stage = options[:stage] || STAGE_DEV
UI.message("Fetched ios #{stage} keyfile from codesigning repo #{CRYPTEX_REPO}")
end
lane :release_prod do
# do magic here
end
endapps/someapp/package.json
{
"name": "@you/someapp",
"version": "0.0.1",
"scripts": {
"fastlane": "fastlane"
}
}apps/someapp/fastlane/config.yml
application:
id: com.you.someappapps/someapp/fastlane/Fastfile
$VERBOSE = nil
import '../../../packages/fastlane/Fastfile'现在您可以运行:
yarn app:someapp fastlane setup或者
yarn app:someapp fastlane ios keystore_get stage:'development'
yarn app:someapp fastlane android keystore_get stage:'development'您甚至可以在CI中执行以下操作:
YOU_FASTLANE__CODESIGNING__GIT_URL=https://github.com/your/repo.git \
yarn app:someapp fastlane ios release_prod
YOU_FASTLANE__CODESIGNING__GIT_URL=https://github.com/your/repo.git \
yarn app:someapp fastlane android release_prod这里有一些额外的内容:
纱线工作区,便于单次使用
the ruby config gem为了促进比dotenv更好的事情
https://stackoverflow.com/questions/38085448
复制相似问题