Last active
August 22, 2022 08:17
-
-
Save lukepighetti/aaded69911db09486c064cb99c44fd9e to your computer and use it in GitHub Desktop.
How I build and release Flutter side projects on iOS https://twitter.com/luke_pighetti/status/1530156415611969537
This file contains 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(:ios) | |
APPLE_ISSUER_ID = ENV["APPLE_ISSUER_ID"] | |
APPLE_KEY_CONTENT = ENV["APPLE_KEY_CONTENT"] | |
APPLE_KEY_ID = ENV["APPLE_KEY_ID"] | |
DEVELOPER_APP_ID = ENV["DEVELOPER_APP_ID"] | |
DEVELOPER_APP_IDENTIFIER = ENV["DEVELOPER_APP_IDENTIFIER"] | |
GIT_AUTHORIZATION = ENV["GIT_AUTHORIZATION"] | |
GITHUB_RUN_NUMBER = ENV["GITHUB_RUN_NUMBER"] | |
PROVISIONING_PROFILE_SPECIFIER = ENV["PROVISIONING_PROFILE_SPECIFIER"] | |
VERSION_NUMBER = ENV["VERSION_NUMBER"] | |
platform :ios do | |
lane :beta do | |
setup_ci() | |
api_key = app_store_connect_api_key( | |
issuer_id: APPLE_ISSUER_ID, | |
key_content: APPLE_KEY_CONTENT, | |
key_id: APPLE_KEY_ID, | |
) | |
cocoapods( | |
clean_install: true | |
) | |
match( | |
type: 'appstore', | |
app_identifier: DEVELOPER_APP_IDENTIFIER, | |
git_basic_authorization: Base64.strict_encode64(GIT_AUTHORIZATION), | |
readonly: true, | |
api_key: api_key, | |
) | |
increment_version_number( | |
version_number: VERSION_NUMBER | |
) | |
increment_build_number( | |
build_number: GITHUB_RUN_NUMBER.to_i | |
) | |
gym( | |
configuration: "Release", | |
workspace: "Runner.xcworkspace", | |
scheme: "your_schema", | |
export_method: "app-store", | |
export_options: { | |
provisioningProfiles: { | |
DEVELOPER_APP_ID => PROVISIONING_PROFILE_SPECIFIER | |
} | |
} | |
) | |
pilot( | |
apple_id: DEVELOPER_APP_ID, | |
app_identifier: DEVELOPER_APP_IDENTIFIER, | |
ipa: "./Runner.ipa", | |
skip_waiting_for_build_processing: true, | |
) | |
end | |
end |
This file contains 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
name: CD | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy to TestFlight | |
runs-on: macos-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- run: flutter pub get | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "2.7.2" | |
- uses: maierj/[email protected] | |
with: | |
lane: beta | |
subdirectory: "ios" | |
env: | |
APP_STORE_CONNECT_TEAM_ID: "${{ secrets.APP_STORE_CONNECT_TEAM_ID }}" | |
APPLE_ISSUER_ID: "${{ secrets.APPLE_ISSUER_ID }}" | |
APPLE_KEY_CONTENT: "${{ secrets.APPLE_KEY_CONTENT }}" | |
APPLE_KEY_ID: "${{ secrets.APPLE_KEY_ID }}" | |
DEVELOPER_APP_ID: "${{ secrets.DEVELOPER_APP_ID }}" | |
DEVELOPER_APP_IDENTIFIER: "${{ secrets.DEVELOPER_APP_IDENTIFIER }}" | |
DEVELOPER_PORTAL_TEAM_ID: "${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}" | |
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: "${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}" | |
FASTLANE_APPLE_ID: "${{ secrets.FASTLANE_APPLE_ID }}" | |
GIT_AUTHORIZATION: "${{ secrets.GIT_AUTHORIZATION }}" | |
GITHUB_RUN_NUMBER: "${{ github.run_number }}" | |
MATCH_PASSWORD: "${{ secrets.MATCH_PASSWORD }}" | |
PROVISIONING_PROFILE_SPECIFIER: "${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}" | |
VERSION_NUMBER: "1.0.0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Secrets
Triggering method