Skip to content

Commit

Permalink
chore: sub
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Oct 22, 2024
1 parent c315374 commit 733ea2e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

source "https://rubygems.org"

gem 'fastlane', "2.224.0"
gem 'fastlane', "2.225.0"
gem 'cocoapods', "1.15.2"
gem 'cocoapods-acknowledgements'

Expand Down
30 changes: 22 additions & 8 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ app_name = i18nEnJSON['app']['name']
app_resources_path = ENV["APP_RESOURCES"] || "App_Resources" # based on nativescript.config.js !!!
app_build_path = ENV["APP_BUILD_PATH"] || "platforms" # based on nativescript.config.js !!!
metadata_path = ENV["SUPPLY_METADATA_PATH"] || "metadata"
metadata_path_realpath = File.join(project_root_path, metadata_path)
metadata_path_realpath = File.join(project_root_path, 'fastlane', metadata_path)

tag_prefix = ENV["TAG_PREFIX"] || ""
ignore_app_scope = ENV["IGNORE_APP_SCOPE"]
Expand Down Expand Up @@ -199,7 +199,7 @@ lane :build_flavor do |params|
svelteCheck

build_output = build(flavor: flavor, options: options)

puts "build_output #{JSON.pretty_generate(build_output)}"
# copy dist files to dist, already done on iOS
if (platform == 'android')
puts "copy dist files to #{dist_path}"
Expand Down Expand Up @@ -239,7 +239,7 @@ lane :build_flavor do |params|
set_github_release(
repository_name: repository_name,
api_token: ENV["GH_TOKEN"],
name: "#{app_name}(**#{platform}**): v#{version} Build #{versionCode}",
name: "#{app_name}(#{platform}): v#{version} Build #{versionCode}",
tag_name: tag,
description: changelog,
upload_assets: Dir.glob(File.join(dist_path, "*.apk"))
Expand All @@ -261,18 +261,18 @@ lane :build_flavor do |params|
# )
# end
when 'alpha','beta','production'
upload_store(changelog:changelog, version: version, versionCode: versionCode, flavor:flavor, options:options, build_output:build_output)
if (platform == 'ios')
# we now github create releases on iOS for european users
set_github_release(
repository_name: repository_name,
api_token: ENV["GH_TOKEN"],
name: "#{app_name}(**#{platform}**): v#{version} Build #{versionCode}",
name: "#{app_name}(#{platform}): v#{version} Build #{versionCode}",
tag_name: tag,
description: changelog,
upload_assets: Dir.glob(File.join(dist_path, "*.ipa"))
)
end
upload_store(changelog:changelog, version: version, versionCode: versionCode, flavor:flavor, options:options, build_output:build_output)
end
if (options[:create_tag] != false)
git_pull
Expand Down Expand Up @@ -371,16 +371,29 @@ platform :ios do

end
lane :upload_store do |params|
build_output = params[:build_output]
api_key = build_output['api_key']
# if (ENV["GITHUB_ACTIONS"] == 'true')
# # get a new key as the build process might be long and the last ke
# # might be expired
# api_key = app_store_connect_api_key(
# key_id: ENV['APPLE_KEY_ID'],
# issuer_id: ENV['APPLE_ISSUER_ID'],
# key_content: ENV['APPLE_KEY_CONTENT']
# )
# puts "upload_store generating api_key #{api_key}"
# end
if (params[:flavor] == "production")
upload_to_app_store(
api_key: api_key,
ignore_language_directory_validation: true,
metadata_path:File.join(metadata_path_realpath, "ios"),
screenshots_path:File.join(metadata_path_realpath, "ios", "screenshots"),
force: true,
automatic_release: true,
reject_if_possible: true,
submit_for_review: false,
skip_metadata: true,
skip_metadata: !options[:upload_metadata],
skip_screenshots: !options[:upload_screenshots],
overwrite_screenshots: !options[:upload_screenshots],
release_notes: {
Expand All @@ -392,12 +405,11 @@ platform :ios do
}
)
else
build_output = params[:build_output]
upload_to_testflight(
changelog:params[:changelog],
distribute_external: true,
groups: [params[:flavor]],
api_key: build_output[:api_key],
api_key: api_key,
# skip_waiting_for_build_processing: true
notify_external_testers: true
)
Expand All @@ -409,6 +421,7 @@ platform :ios do
if (ENV["GITHUB_ACTIONS"] == 'true')
api_key = app_store_connect_api_key(
key_id: ENV['APPLE_KEY_ID'],
duration: 1200,
issuer_id: ENV['APPLE_ISSUER_ID'],
key_content: ENV['APPLE_KEY_CONTENT']
)
Expand All @@ -423,6 +436,7 @@ platform :ios do
if (ENV["GITHUB_ACTIONS"] == 'true')
api_key = app_store_connect_api_key(
key_id: ENV['APPLE_KEY_ID'],
duration: 1200,
issuer_id: ENV['APPLE_ISSUER_ID'],
key_content: ENV['APPLE_KEY_CONTENT']
)
Expand Down
6 changes: 4 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const sveltePreprocess = require('svelte-preprocess');
const { existsSync } = require('fs');
const { resolve } = require('path');

let customPreprocess;
if (existsSync('./svelte.config.custom.js')) {
customPreprocess = require('./svelte.config.custom.js');
const customPath = resolve('./svelte.config.custom.js');
if (existsSync(customPath)) {
customPreprocess = require(customPath);
}
// this can be called either through svelte-loader where we want either __ANDROID__ or __IOS__ to be defined but not both
// or through svelte-check where we want both so everything is checked
Expand Down
2 changes: 1 addition & 1 deletion tools
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ __metadata:

"@akylas/nativescript-app-tools@file:tools::locator=root-workspace-0b6124%40workspace%3A.":
version: 1.0.0
resolution: "@akylas/nativescript-app-tools@file:tools#tools::hash=8c3eae&locator=root-workspace-0b6124%40workspace%3A."
resolution: "@akylas/nativescript-app-tools@file:tools#tools::hash=8e5284&locator=root-workspace-0b6124%40workspace%3A."
dependencies:
"@dotenvx/dotenvx": "npm:1.19.3"
"@nativescript-community/fontmin": "npm:0.9.11"
Expand Down Expand Up @@ -81,7 +81,7 @@ __metadata:
typescript: "npm:5.6.3"
typescript-eslint: "npm:^8.9.0"
webpack-bundle-analyzer: "npm:^4.10.2"
checksum: 10/d192578373e92ea32a4300be3b8060f2dae1959151529567a0b99b6beac07c667dd6fe44882c34944dbb7896b49974f76f6e3e9ee4f1c7fc3fbdbfb4dd379166
checksum: 10/26d3f921b2a2289a391f6258f0bb9d5f4d499b7d0ddc384903aff9090f549b176a1330937583b49e638f284e48995183f93ed6d613d1055f635e67b686c062e9
languageName: node
linkType: hard

Expand Down

0 comments on commit 733ea2e

Please sign in to comment.