ss-n.app

リリース情報とか諸々

fastlane matchで既存の証明書を利用する

iOSのfastlane matchで既存の証明書をそのまま利用として困ったので書くことにします。

もともとこちらを参考に対応したところエラーが。。。 qiita.com

NameError: uninitialized constant Match::GitHelper

えー。。って思い調査

そしたらこんなissueが

github.com

あーーー、なるほど!

rubyのバージョンね!

納得(^ω^)

細かい差分はこちらの記事に書いてありました。 medium.com

つまりまとめると

2.105.2以下はこちら

irb(main):001:0> require 'match'
irb(main):002:0> git_url = 'git@github.com:path-to/the-encrypted-certs-repo.git'
 => "git@github.com:path-to/the-encrypted-certs-repo.git" irb(main):003:0> shallow_clone = false
 => false
irb(main):004:0> manual_password = 'password-to-decrypt-the-repo'
 => "password-to-decrypt-the-repo"

ファイルを追加

irb(main):005:0> workspace = Match::GitHelper.clone(git_url, shallow_clone, manual_password: manual_password)

それ以上はこちら

irb(main):001:0> require 'match'
irb(main):002:0> git_url = 'git@github.com:path-to/the-encrypted-certs-repo.git'
=> "git@github.com:path-to/the-encrypted-certs-repo.git"
irb(main):003:0> shallow_clone = false
=> false
irb(main):004:0> ENV["MATCH_PASSWORD"] = 'password-to-decrypt-the-repo'
=> "password-to-decrypt-the-repo"
irb(main):005:0> branch = 'master'
=> "master"

ファイルを追加

irb(main):010:0> encryption.encrypt_files
irb(main):011:0> files_to_commit = Dir[File.join(storage.working_directory, "**", "*.{cer,p12,mobileprovision}")]
irb(main):012:0> storage.save_changes!(files_to_commit: files_to_commit)

解決!!!!

基本的にここ近年はruby2.4系とかでiOS開発してる人が多いんじゃないかなって思ってますが、俺だけですか?