xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / macOS / fastlane / Fastfile
Fastfile66 lines · 1.5 KiBRaw
| 1 | default_platform(:mac) |
| 2 | |
| 3 | ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" |
| 4 | |
| 5 | lane :package do |
| 6 | xcodegen |
| 7 | |
| 8 | # Config is controlled via env vars |
| 9 | app_store_connect_api_key( |
| 10 | is_key_content_base64: true, |
| 11 | ) |
| 12 | |
| 13 | create_keychain( |
| 14 | name: "xtool.keychain", |
| 15 | password: "", |
| 16 | unlock: true, |
| 17 | ) |
| 18 | |
| 19 | unlock_keychain( |
| 20 | path: "xtool.keychain", |
| 21 | password: "", |
| 22 | ) |
| 23 | |
| 24 | Tempfile.create(["Identity", ".p12"]) do |file| |
| 25 | file.write(Base64.decode64(ENV["IDENTITY_P12"])) |
| 26 | file.close |
| 27 | import_certificate( |
| 28 | certificate_path: file.path, |
| 29 | keychain_name: "xtool.keychain", |
| 30 | keychain_password: "", |
| 31 | ) |
| 32 | end |
| 33 | |
| 34 | sigh( |
| 35 | platform: "macos", |
| 36 | output_path: "./Build/Signing", |
| 37 | force: true, |
| 38 | developer_id: true, |
| 39 | ) |
| 40 | |
| 41 | update_code_signing_settings( |
| 42 | use_automatic_signing: false, |
| 43 | team_id: ENV["DEVELOPMENT_TEAM"], |
| 44 | code_sign_identity: "Developer ID Application", |
| 45 | profile_name: lane_context[SharedValues::SIGH_NAME], |
| 46 | ) |
| 47 | |
| 48 | gym( |
| 49 | export_method: "developer-id", |
| 50 | output_directory: "./Build/Output", |
| 51 | ) |
| 52 | |
| 53 | notarize( |
| 54 | package: "./Build/Output/xtool.app", |
| 55 | ) |
| 56 | |
| 57 | # we need to re-package after notarization and stapling. |
| 58 | # we have to use `ditto --sequesterRsrc` rather than zip |
| 59 | # because the default strategy stores resource forks as |
| 60 | # ._Foo but codesigning doesn't like that, and instead |
| 61 | # wants them in __MACOSX. |
| 62 | sh( |
| 63 | "ditto", "-c", "-k", "--keepParent", "--sequesterRsrc", |
| 64 | "../Build/Output/xtool.app", "../Build/Output/xtool.app.zip", |
| 65 | ) |
| 66 | end |