-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (123 loc) · 4.22 KB
/
build.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# This is a basic workflow to help you get started with Actions
name: build-ipa
# Controls when the workflow will run
on: [push, workflow_dispatch]
jobs:
build:
# Our self hosted runner
runs-on: franz
if: "!startsWith(github.event.head_commit.message, 'chore(release): ')"
env:
LANG: en_US.UTF-8
steps:
- name: Configuring Git
run: |
git config --global user.name "high5-bot"
git config --global user.email "[email protected]"
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.HIGH5_BOT_TOKEN }}
# Checkout certificates
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.HIGH5_BOT_TOKEN }}
repository: 'ridenui/certificates'
path: 'certificates'
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '^13.2.1'
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install yarn
run: npm i yarn --global
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Installing dependencies
run: yarn
- uses: ruby/setup-ruby@v1
env:
ImageOS: macos11
with:
ruby-version: 2.7.2
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/cache@v2
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install pods
run: (cd ios && (bundle exec pod install || bundle exec pod install --repo-update))
- name: Build app
run: |
yarn start & echo "METRO_PID=$!" >> $GITHUB_ENV
bundle exec fastlane ios ci
- name: Branch name with dash
run: |
echo "CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's/\//-/g')" >> $GITHUB_ENV
- name: Upload ipa as artifact
uses: actions/upload-artifact@v2
with:
name: ipa-${{ env.CURRENT_BRANCH }}
path: build
- name: Clean up keychain and provisioning profile
if: ${{ always() }}
env:
METRO_PID: ${{ env.METRO_PID }}
run: |
echo "Kill metro with pid $METRO_PID"
kill -9 $METRO_PID || true
echo "Fastlane ci_cleanup"
bundle exec fastlane ios ci_cleanup || true
ota:
runs-on: ubuntu-latest
needs: [build]
if: "!startsWith(github.event.head_commit.message, 'chore(release): ')"
steps:
- name: Configuring Git
run: |
git config --global user.name "high5-bot"
git config --global user.email "[email protected]"
- name: Branch name with dash
run: |
echo "CURRENT_BRANCH_SLASH_LESS=$(echo $GITHUB_REF_NAME | sed 's/\//-/g')" >> $GITHUB_ENV
echo "CURRENT_BRANCH=$(echo $GITHUB_REF_NAME)" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.HIGH5_BOT_TOKEN }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.HIGH5_BOT_TOKEN }}
repository: 'ridenui/mobileapp'
path: 'page'
ref: 'gh-pages'
- name: Create ota page
run: (cd ci && yarn && node ./generate-ota.mjs)
- uses: actions/download-artifact@v2
with:
name: ipa-${{ env.CURRENT_BRANCH_SLASH_LESS }}
path: page/ota/${{ github.ref_name }}
- name: Debug
run: tree
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: page
clean: false
token: ${{ secrets.HIGH5_BOT_TOKEN }}
git-config-name: high5-bot
git-config-email: [email protected]