Created
August 20, 2021 02:46
-
-
Save dezinezync/6afe37a6f65ccad9b9a19a9ef98fb978 to your computer and use it in GitHub Desktop.
Build a macOS App and notarize it using Fastlane
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default_platform(:mac) | |
platform :mac do | |
before_all do | |
# Make sure we start off with a clean slate | |
ensure_git_status_clean | |
end | |
desc "Create a notarized build of the macOS App" | |
lane :notarized do | |
# ensure_git_branch( | |
# branch: 'dev' | |
# ) | |
increment_build_number( | |
xcodeproj: "Project.xcodeproj" | |
) | |
build_mac_app( | |
scheme: 'Project', # Skip if you only have a single scheme | |
configuration: 'Release', | |
export_method: "developer-id", | |
xcargs: '-allowProvisioningUpdates' # Needed for automatic signing | |
) | |
notarize( | |
asc_provider: "XXXXXXXXXX", | |
username: '[email protected]', | |
print_log: true, | |
package: './Project.app', | |
verbose: true # Useful for showing notarization logs if it fails | |
) | |
end | |
after_all do |lane| | |
say "done" | |
commit_version_bump( | |
message: 'Version Bump via Fastlane', | |
xcodeproj: 'Project.xcodeproj', # optional, if you have multiple Xcode project files, you must specify your main project here | |
) | |
add_git_tag | |
push_to_git_remote | |
end | |
# Handle errors | |
error do |lane, exception| | |
# reset version bumps | |
reset_git_repo( | |
disregard_gitignore: false | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment