Skip to content

Instantly share code, notes, and snippets.

@watura
Last active October 28, 2020 21:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watura/2b26cd2db748ba921800146c91da7135 to your computer and use it in GitHub Desktop.
Save watura/2b26cd2db748ba921800146c91da7135 to your computer and use it in GitHub Desktop.
Flutter ios firebase app distribution
require 'fileutils'
default_platform :ios
platform :ios do
before_all do |lane, options|
if is_ci
ENV['MATCH_KEYCHAIN_NAME'] = 'TempKeychain'
ENV['MATCH_KEYCHAIN_PASSWORD'] = 'TempKeychainPassword'
create_temp_keychain
end
end
lane :build do
match(readonly: is_ci)
automatic_code_signing(
code_sign_identity: "iPhone Distribution",
team_id: ENV["sigh_BUNDLE_IDENTIFIER_adhoc_team-id"],
profile_name: ENV["sigh_BUNDLE_IDENTIFIER_adhoc_profile-name"]
)
gym()
end
private_lane :create_temp_keychain do
create_keychain(
name: ENV['MATCH_KEYCHAIN_NAME'],
password: ENV['MATCH_KEYCHAIN_PASSWORD'],
timeout: 1800
)
end
end
name: flutter_build_deploy_ios
on:
push:
branches:
- master
jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1.1.1
with:
channel: 'dev'
- name: Flutter setup
run: |
flutter pub get
flutter build ios --release --no-codesign
- name: Build
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
MATCH_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
run: |
cd ios
fastlane build
- name: Use Node.js 8.x
uses: actions/setup-node@v1
with:
node-version: 8.x
- name: Install Firebase
run: yarn install
- name: Upload ipa
run: yarn run firebase appdistribution:distribute ios/build/Runner.ipa --app "${{ secrets.IOS_APP_ID }}" --token "${{ secrets.FIREBASE_TOKEN }}"
scheme("Runner")
clean(true)
export_method("ad-hoc")
export_xcargs("-allowProvisioningUpdates")
output_directory("./build")
codesigning_identity("Apple Distribution: ")
if ENV["PERSONAL_TOKEN"] != nil # CI でも ローカルでも同じ様に動く様にしたい
git_url("https://" + ENV["PERSONAL_TOKEN"] + "@github.com/watura/Certificates.git")
else
git_url("https://github.com/watura/Certificates.git)
end
storage_mode("git")
type("adhoc")
app_identifier("APP_IDENTIFIER")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment