-
Notifications
You must be signed in to change notification settings - Fork 44
134 lines (131 loc) · 4.98 KB
/
publish-sample.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: publish sample application
on:
workflow_dispatch:
inputs:
platform:
description: 'Select target platform'
required: true
type: choice
options:
- All
- Android
- iOS
version:
description: 'version (optional)'
required: false
type: string
default: ''
jobs:
execute:
runs-on: ubuntu-latest
steps:
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: '[${{ github.event.inputs.platform }}] Deploy trigger'
if: ${{github.event.inputs.platform}}
uses: promiseofcake/circleci-trigger-action@v1
with:
user-token: ${{ secrets.CIRCLECI_PERSONAL_API_TOKEN }}
project-slug: sendbird/sendbird-uikit-react-native
branch: ${{ env.BRANCH_NAME }}
payload: '{"platform": "${{ github.event.inputs.platform }}", "version": "${{ github.event.inputs.version }}" }'
#env:
# CACHE_NODE_MODULES_PATH: |
# node_modules
# packages/*/node_modules
# sample/node_modules
#
#jobs:
# deploy-android:
# name: '[Android] Deploy'
# if: ${{ github.event.inputs.platform == 'Android' || github.event.inputs.platform == 'All' }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v1
# with:
# node-version: 16.x
# - uses: ruby/setup-ruby@v1
# env:
# BUNDLE_GEMFILE: ${{ github.workspace }}/sample/android/Gemfile
# with:
# ruby-version: 2.7
# bundler-cache: true
# - name: Get lockfile hash
# id: lockfile_hash
# run: echo "::set-output name=hash::${{ hashFiles('**/yarn.lock') }}"
# - name: Check cached node_modules
# id: check_cache
# uses: actions/cache@v2
# with:
# path: ${{ env.CACHE_NODE_MODULES_PATH }}
# key: ${{ steps.lockfile_hash.outputs.hash }}
# - name: Install dependencies
# if: steps.check_cache.outputs.cache-hit == ''
# run: yarn install --frozen-lockfile
# - name: Create env.ts
# run:
# echo "export const APP_ID = '${{ secrets.sendbird_app_id }}';" >> sample/src/env.ts
#
# - name: Create service-account.json
# uses: /bang9/create-env-json@v3
# id: service-account
# with:
# file-name: './sample/android/fastlane/service-account.json'
# type: 'service_account'
# auth_uri: 'https://accounts.google.com/o/oauth2/auth'
# token_uri: 'https://oauth2.googleapis.com/token'
# auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs'
# project_id: ${{ secrets.fastlane_android_account_project_id }}
# private_key_id: ${{ secrets.fastlane_android_account_private_key_id }}
# private_key: '${{ secrets.fastlane_android_account_private_key }}'
# client_email: ${{ secrets.fastlane_android_account_client_email }}
# client_id: ${{ secrets.fastlane_android_account_client_id }}
# client_x509_cert_url: ${{ secrets.fastlane_android_account_client_x509_cert_url }}
# - name: Run fastlane
# env:
# FIREBASEAPPDISTRO_APP: ${{ secrets.fastlane_android_app_id }}
# GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.service-account.outputs.full-path }}
# run: yarn deploy:android
#
# deploy-ios:
# name: '[iOS] Deploy'
# if: ${{ github.event.inputs.platform != 'Android' }}
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v1
# with:
# node-version: 16.x
# - uses: ruby/setup-ruby@v1
# env:
# BUNDLE_GEMFILE: ${{ github.workspace }}/sample/ios/Gemfile
# with:
# ruby-version: 2.7
# bundler-cache: true
# - name: Get lockfile hash
# id: lockfile_hash
# run: echo "::set-output name=hash::${{ hashFiles('**/yarn.lock') }}"
# - name: Check cached node_modules
# id: check_cache
# uses: actions/cache@v2
# with:
# path: ${{ env.CACHE_NODE_MODULES_PATH }}
# key: ${{ steps.lockfile_hash.outputs.hash }}
# - name: Install dependencies
# if: steps.check_cache.outputs.cache-hit == ''
# run:
# yarn install --frozen-lockfile
# - name: Install pods
# run: cd sample/ios && pod install
# - name: Create env.ts
# run:
# echo "export const APP_ID = '${{ secrets.sendbird_app_id }}';" >> sample/src/env.ts
# - name: Run fastlane
# env:
# TEAM_ID: ${{ secrets.fastlane_ios_team_id }}
# MATCH_PASSWORD: ${{ secrets.fastlane_ios_match_password }}
# MATCH_GIT_URL: ${{ secrets.fastlane_ios_match_git_url }}
# MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.fastlane_ios_match_git_basic_authorization }}
# APPLE_ID: ${{ secrets.fastlane_ios_apple_id }}
# FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.fastlane_ios_apple_application_specific_password }}
# run: yarn deploy:ios