Skip to content

Commit

Permalink
Merge pull request #7 from openfoodfacts/ios-metadata
Browse files Browse the repository at this point in the history
feat: Upload Smoothie's metadata to Apple AppStore
  • Loading branch information
teolemon authored May 9, 2022
2 parents fda9192 + b97137a commit 2101a3f
Show file tree
Hide file tree
Showing 78 changed files with 571 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ios-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Upload Metadata for iOS using Fastlane
on:
push:
branches:
- 'ios-metadata'

jobs:
testflight-release:
name: Build and deploy to TestFlight testers
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Version
run: echo ${{ env.RELEASE_VERSION }}

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.0.2
- name: Bundle install
run: cd ./fastlane/ios/fastlane && gem install bundler:1.17.3 && bundle install && pwd && ls

- name: Decrypt AuthKey file
run: pwd && ls && cd ./fastlane/ios/fastlane/envfiles && ./decrypt_secrets.sh && ls && pwd
env:
AUTH_KEY_FILE_DECRYPTKEY: ${{ secrets.AUTH_KEY_FILE_DECRYPTKEY }}

- name: Publish marketing assets
run: cd ./fastlane/ios/fastlane && pwd && ls && bundle exec fastlane metadata
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
PILOT_APPLE_ID: ${{ secrets.PILOT_APPLE_ID }}
SPACESHIP_CONNECT_API_ISSUER_ID: ${{ secrets.SPACESHIP_CONNECT_API_ISSUER_ID }}
SPACESHIP_CONNECT_API_KEY_ID: ${{ secrets.SPACESHIP_CONNECT_API_KEY_ID }}
SPACESHIP_CONNECT_API_KEY_FILEPATH: ./fastlane/envfiles/AuthKey_KDAUTTM76R.p8
CI_RELEASE: true

4 changes: 4 additions & 0 deletions fastlane/ios/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
app_identifier "org.openfoodfacts.app"
team_id "ZC9CYWD334"
apple_id(ENV["FASTLANE_USER"])
itc_team_id(ENV["APP_STORE_CONNECT_TEAM_ID"])
9 changes: 9 additions & 0 deletions fastlane/ios/fastlane/Deliverfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
force true # To go into non interactive mode
app_identifier "org.openfoodfacts.app"
username ENV["APPLE_ID"]
app_icon "./fastlane/ios/fastlane/metadata/Icon-App-iTunes.png"
screenshots_path "./fastlane/ios/fastlane/screenshots"
metadata_path "./fastlane/ios/fastlane/metadata"

#languages Metadata: List of languages to activate

104 changes: 104 additions & 0 deletions fastlane/ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
default_platform(:ios)

before_all do
xcversion(version: "~> 12.2")
end

platform :ios do
desc "Precheck metadata for Apple compliance"
lane :precheck do
precheck
end

desc "Push only description and meta info"
lane :metadata do

api_key = app_store_connect_api_key(
key_id: ENV["SPACESHIP_CONNECT_API_KEY_ID"],
issuer_id: ENV["SPACESHIP_CONNECT_API_ISSUER_ID"],
key_filepath: ENV["SPACESHIP_CONNECT_API_KEY_FILEPATH"]
)
deliver(
api_key: api_key,
skip_screenshots: false,
skip_metadata: false,
force: true, # To go into non interactive mode
precheck_include_in_app_purchases: false
)
end

desc "Sending metadata for Smoothie to TestFlight"
lane :beta do

APP_IDENTIFIER = "org.openfoodfacts.app"

puts "Sending metadata for identifier #{APP_IDENTIFIER}"

sync_code_signing(type: "appstore", readonly: is_ci, clone_branch_directly: false)
update_code_signing_settings(
path: "Runner.xcodeproj",
use_automatic_signing: false,
build_configurations: "Release",
code_sign_identity: 'iPhone Distribution',
profile_name: 'match AppStore org.openfoodfacts.app',
targets: ["Runner"]
)

update_project_team(
path: "Runner.xcodeproj",
teamid: "ZC9CYWD334"
)

# Upload to test flight
pilot(
app_identifier: APP_IDENTIFIER,
skip_submission: true,
skip_waiting_for_build_processing: true,
#ipa: "./Runner.ipa"
#skip_screenshots: false,
#skip_metadata: false
)
end


lane :setVersion do
begin

new_version_name = ENV["VERSION_NAME"]
new_version_name = new_version_name.to_s
new_version_name = new_version_name[8..-1]
puts new_version_name

api_key = app_store_connect_api_key(
key_id: ENV["SPACESHIP_CONNECT_API_KEY_ID"],
issuer_id: ENV["SPACESHIP_CONNECT_API_ISSUER_ID"],
key_filepath: ENV["SPACESHIP_CONNECT_API_KEY_FILEPATH"]
)


old_version_code = app_store_build_number(
live: false,
api_key: api_key,
app_identifier: "org.openfoodfacts.app",
initial_build_number: "0",
version: new_version_name
)
new_version_code = old_version_code.to_i + 1

puts "old_version_code: " + old_version_code.to_s
puts "new_version_code: " + new_version_code.to_s




flutter_set_version(
path_to_yaml: "../pubspec.yaml",
version_name: new_version_name,
version_code: new_version_code.to_s,
)
end
end



end
12 changes: 12 additions & 0 deletions fastlane/ios/fastlane/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

source "https://rubygems.org"

gem "fastlane"
gem "fastlane-plugin-flutter_version", git: "https://github.com/tianhaoz95/fastlane-plugin-flutter-version"
gem "xcode-install"

plugins_path = File.join(File.dirname(__FILE__), './fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Loading

0 comments on commit 2101a3f

Please sign in to comment.