Added fastlane scripts, old ids cleaned up

This commit is contained in:
Alex Kh 2021-12-22 17:38:17 +04:00
parent 39e348948c
commit 56754d616b
34 changed files with 1361 additions and 153 deletions

7
client/fastlane/Appfile Normal file
View file

@ -0,0 +1,7 @@
app_identifier(["org.amnezia.AmneziaVPN", "org.amnezia.AmneziaVPN.network-extension"]) # The bundle identifier of your app
apple_id("dartsyms@gmail.com") # Your Apple email address
itc_team_id("122591025") # App Store Connect Team ID
team_id("X7UJ388FXK") # Developer Portal Team ID
#itc_team_id("119381903")
#team_id("7VAGZXD78P")

197
client/fastlane/Fastfile Normal file
View file

@ -0,0 +1,197 @@
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
project_name = "AmneziaVPN"
project_scheme = "AmneziaVPN"
project_identifier = "org.amnezia.AmneziaVPN"
itunes_username = "dartsyms@gmail.com"
before_all do
ENV['GYM_SCHEME'] = project_scheme
end
def tag_name(version_number, build_number)
"#{version_number}_#{build_number}"
end
def incrementBuild
increment_build_number(xcodeproj: "./#{project_name}.xcodeproj")
end
default_platform :ios
# Fastfile actions accept additional configuration, but
# don't worry, fastlane will prompt you for required
# info which you can add here later
lane :beta do
# build your iOS app
build_app(
scheme: "AmneziaVPN",
export_method: "ad-hoc"
)
end
lane :incrementVersion do
increment_build_number(
xcodeproj: "./#{project_name}.xcodeproj"
)
version_number = get_version_number(
xcodeproj: "./#{project_name}.xcodeproj",
target: project_name
)
build_number = get_build_number(
xcodeproj: "./#{project_name}.xcodeproj"
)
puts "Version = #{version_number} Build = #{build_number}"
end
desc "Update Certificates, Run All tests, Build app"
desc "Add tag to git, send to Testflight, slack notification"
lane :addToTestFlight do
certificates
clean_build_artifacts
build_app(
scheme: project_scheme,
configuration: "Release", # Debug / Release
export_method: "app-store", # Valid values are: app-store, ad-hoc, package, enterprise, development, developer-id
clean: true,
include_bitcode: false,
include_symbols: true,
export_options: {
provisioningProfiles: {
"org.amnezia.AmneziaVPN"=>"match AppStore org.amnezia.AmneziaVPN",
"org.amnezia.AmneziaVPN.network-extension"=>"match development AmneziaVPN networkextension",
}
},
output_directory: "fastlane/build/", # Destination directory. Defaults to current directory.
output_name: "#{project_name}.ipa"
)
testflight(
username: itunes_username,
app_identifier: project_identifier,
ipa: "fastlane/build/#{project_name}.ipa",
skip_waiting_for_build_processing: true
)
# Section for Slack
version_number = get_version_number(
xcodeproj: "./#{project_name}.xcodeproj",
target: project_name
)
build_number = get_build_number(
xcodeproj: "./#{project_name}.xcodeproj"
)
msg = "Build v.#{version_number} (#{build_number}) was Created for TestFlight"
puts msg
# msgToSlack(msg, true)
increment_build_number
end
lane :certificates do
match(
username: itunes_username,
type: "appstore",
app_identifier: [project_identifier],
readonly: true,
git_url: "https://github.com/amnezia-vpn/amnezia-ios-certificates.git"
)
notification(subtitle: "Finished", message: "Certificates done")
end
lane :adhoc_certificates do
match(
username: itunes_username,
type: "adhoc",
app_identifier: [project_identifier],
readonly: true,
git_url: "https://github.com/amnezia-vpn/amnezia-ios-certificates.git"
)
notification(subtitle: "Finished", message: "Certificates done")
end
lane :createAPNS do
get_push_certificate(
force: true, # create a new profile, even if the old one is still valid
app_identifier: project_identifier, # optional app identifier,
username: itunes_username,
p12_password: apns_pass,
pem_name: apns_pem_name,
output_path: "fastlane/APNS",
save_private_key: true,
new_profile: proc do |profile_path| # this block gets called when a new profile was generated
puts profile_path # the absolute path to the new PEM file
# insert the code to upload the PEM file to the server
end
)
# msgToSlack("Successfully APNS Created", true)
end
desc "Distribute app via Firebase for testers"
lane :firebase_test do
adhoc_certificates
build_ios_app(
scheme: project_scheme,
output_directory: "./fastlane/builds/#{project_scheme}",
output_name: "#{project_scheme}.ipa",
export_options: {
method: "ad-hoc",
compileBitcode: false
},
clean: true,
include_bitcode: true,
include_symbols: true,
skip_package_ipa: false
)
# firebase_app_distribution(
# app: "1:880592554695:ios:af464a9ed02207f6284ce2",
# testers: "dartsyms@gmail.com, shogun14@yandex.ru, qa@wevied.com",
# release_notes: "Another build: ready to test."
# )
clean_build_artifacts
increment_build_number
end
desc "Distribute app via Firebase for testers"
lane :distribute_firebase do
adhoc_certificates
clean_build_artifacts
build_ios_app(
scheme: project_scheme,
output_directory: "./fastlane/builds/#{project_scheme}",
output_name: "#{project_scheme}.ipa",
export_options: {
method: "ad-hoc",
compileBitcode: false
},
clean: true,
include_bitcode: true,
include_symbols: true,
skip_package_ipa: false
)
# firebase_app_distribution(
# app: "1:880592554695:ios:af464a9ed02207f6284ce2",
# testers: "dartsyms@gmail.com, shogun14@yandex.ru, qa@wevied.com",
# release_notes: "Another build: ready to test."
# )
end
def msgToSlack(msg, result)
slack(
message: msg,
success: result,
default_payloads: [:lane, :test_result, :git_branch, :git_author] # Optional, lets you specify a whitelist of default payloads to include. Pass an empty array to suppress all the default payloads.
# Don't add this key, or pass nil, if you want all the default payloads. The available default payloads are: `lane`, `test_result`, `git_branch`, `git_author`, `last_git_commit_message`, `last_git_commit_hash`.
)
end

13
client/fastlane/Matchfile Normal file
View file

@ -0,0 +1,13 @@
git_url("https://github.com/amnezia-vpn/amnezia-ios-certificates")
storage_mode("git")
type("appstore") # The default type, can be: appstore, adhoc, enterprise or development
# app_identifier(["tools.fastlane.app", "tools.fastlane.app2"])
# username("user@fastlane.tools") # Your Apple Developer Portal username
# For all available options run `fastlane match --help`
# Remove the # in the beginning of the line to enable the other options
# The docs are available on https://docs.fastlane.tools/actions/match

View file

@ -0,0 +1,6 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
#gem 'fastlane-plugin-run_tests_firebase_testlab'
#gem 'fastlane-plugin-firebase_app_distribution'

88
client/fastlane/README.md Normal file
View file

@ -0,0 +1,88 @@
fastlane documentation
----
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```sh
xcode-select --install
```
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)
# Available Actions
### beta
```sh
[bundle exec] fastlane beta
```
### incrementVersion
```sh
[bundle exec] fastlane incrementVersion
```
### addToTestFlight
```sh
[bundle exec] fastlane addToTestFlight
```
Update Certificates, Run All tests, Build app
Add tag to git, send to Testflight, slack notification
### certificates
```sh
[bundle exec] fastlane certificates
```
### adhoc_certificates
```sh
[bundle exec] fastlane adhoc_certificates
```
### createAPNS
```sh
[bundle exec] fastlane createAPNS
```
### firebase_test
```sh
[bundle exec] fastlane firebase_test
```
Distribute app via Firebase for testers
### distribute_firebase
```sh
[bundle exec] fastlane distribute_firebase
```
Distribute app via Firebase for testers
----
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).
The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="fastlane.lanes">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000294">
</testcase>
<testcase classname="fastlane.lanes" name="1: Switch to certificates lane" time="0.000162">
</testcase>
<testcase classname="fastlane.lanes" name="2: match" time="16.218694">
</testcase>
<testcase classname="fastlane.lanes" name="3: notification" time="0.234117">
</testcase>
<testcase classname="fastlane.lanes" name="4: clean_build_artifacts" time="0.000678">
</testcase>
<testcase classname="fastlane.lanes" name="5: build_app" time="245.559392">
</testcase>
<testcase classname="fastlane.lanes" name="6: testflight" time="66.240632">
</testcase>
<testcase classname="fastlane.lanes" name="7: get_version_number" time="0.122953">
</testcase>
<testcase classname="fastlane.lanes" name="8: get_build_number" time="1.192314">
</testcase>
<testcase classname="fastlane.lanes" name="9: increment_build_number" time="2.5453">
</testcase>
</testsuite>
</testsuites>