Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ ITC_TEAM_ID=
TEAM_ID=
FIREBASE_APP_ID_IOS=
FIREBASE_CLI_TOKEN=
IPA_PATH=
RELEASE_NOTE=
MATCH_GIT_URL=
MATCH_KEYCHAIN_NAME=
MATCH_KEYCHAIN_PASSWORD=
CODE_SIGNING_IDENTITY=
65 changes: 65 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow uses in Template repository only.

name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
distribute:
runs-on: macOS-latest
env:
MINT_PATH: mint/lib
MINT_LINK_PATH: mint/bin

steps:
- uses: actions/checkout@v2
- name: Cache Gem
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Cache Mint
uses: actions/cache@v2
with:
path: mint
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
restore-keys: |
${{ runner.os }}-mint-
- name: Cache npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-mint-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache rbenv
uses: actions/cache@v2
with:
path: /home/runner/.rbenv
key: ${{ runner.os }}-rbenv-${{ hashFiles('**/.ruby-version') }}
restore-keys: |
{{ runner.os }}-rbenv-
- name: Init
run: ./scripts/bootstrap.sh Test com.example.template.Template true
- name: XcodeGen generate
run: mint run xcodegen
- name: Build & Distribute
run: bundle exec fastlane distribute_app
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
TEAM_ID: ${{ secrets.TEAM_ID }}
FIREBASE_APP_ID_IOS: ${{ secrets.FIREBASE_APP_ID_IOS }}
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
CODE_SIGNING_IDENTITY: ${{ secrets.CODE_SIGNING_IDENTITY }}
RELEASE_NOTE: test
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
ruby '2.7.1'

gem 'fastlane'

Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,5 @@ DEPENDENCIES
fastlane
fastlane-plugin-firebase_app_distribution

RUBY VERSION
ruby 2.7.1p83

BUNDLED WITH
2.1.4
38 changes: 32 additions & 6 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,39 @@ default_platform(:ios)
platform :ios do
desc 'Distribute iOS App'
lane :distribute_app do
if is_ci?
create_keychain(
name: ENV['MATCH_KEYCHAIN_NAME'],
password: ENV['MATCH_KEYCHAIN_PASSWORD'],
default_keychain: true,
unlock: true,
timeout: 1800,
lock_when_sleeps: false
)
end
match(
readonly: is_ci,
keychain_name: ENV['MATCH_KEYCHAIN_NAME'],
keychain_password: ENV['MATCH_KEYCHAIN_PASSWORD']
)
update_project_provisioning(
xcodeproj: "{Template}.xcodeproj",
profile: ENV["sigh_{BUNDLE_IDENTIFIER}_development_profile-path"],
code_signing_identity: ENV['CODE_SIGNING_IDENTITY']
)
build_app(
scheme: "Sample",
export_options: {
method: "development"
}
)
firebase_app_distribution(
app: ENV['FIREBASE_APP_ID_IOS'],
groups: "gotties",
ipa_path: ENV['IPA_PATH'],
release_notes: ENV['RELEASE_NOTE'],
firebase_cli_path: "./node_modules/firebase-tools/lib/bin/firebase.js",
firebase_cli_token: ENV['FIREBASE_CLI_TOKEN'],
app: ENV['FIREBASE_APP_ID_IOS'],
groups: "gotties",
ipa_path: "#{Dir.pwd}/../{Template}.ipa",
release_notes: ENV['RELEASE_NOTE'],
firebase_cli_path: "#{Dir.pwd}/../node_modules/firebase-tools/lib/bin/firebase.js",
firebase_cli_token: ENV['FIREBASE_CLI_TOKEN'],
)
end

Expand Down
8 changes: 8 additions & 0 deletions fastlane/Matchfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'dotenv'

# format: https://{Personal Access Token}:x-oauth-basic@github.com/{Organization}/{Repo name}
git_url(ENV['MATCH_GIT_URL'])

storage_mode("git")

type("development") # The default type, can be: appstore, adhoc, enterprise or development
11 changes: 8 additions & 3 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ set_git_hook() {
}

main() {
project_name=$1
bundle_identifier=$2
is_ci=$3
if ! $is_ci; then
check_depends
fi
set_git_hook
check_depends
dependencies
replace_project_name $1
replace_bundle_identifier $2
replace_project_name $project_name
replace_bundle_identifier $bundle_identifier
}

main $1 $2