fastlane에서 env 변수 쓰기

1.[sudo] gem install dotenv

2. touch .env (in fastlane folder)

3. vim env

4. GITHUB_API_TOKEN =”…”

5. In fastlfile

create_pull_request(
  api_token: ENV['GITHUB_API_TOKEN'],
  repo: '...',
  title: "Merge #{currentBranchName} into #{baseBranchName}",
  base: baseBranchName
)

6. Ignore .env file to git

fastlane setting version number according to iTunes Connect

    require 'spaceship'
    Spaceship::Tunes.login
    app = Spaceship::Tunes::Application.find("your app bundle Id")
    version = app.edit_version
    require 'spaceship'
    Spaceship::Tunes.login
    app = Spaceship::Tunes::Application.find("your app bundle Id")
    version = app.edit_version
    if version
      latest_app_version = version.raw_data["version"]["value"]
    else
      puts "No edit version available"
      version = app.live_version
      latest_app_version = version.raw_data["version"]["value"]
    puts "Latest live version: #{latest_app_version}"
    new_version = latest_app_version.to_f + 0.1
    puts "New version: #{format("%.1f", new_version)}"
    end

    increment_version_number(
      version_number: "#{format("%.1f", new_version)}"
    )

//get version from iTunes! and add 0.1 to that version.

reference: https://github.com/fastlane/fastlane/issues/11716