-
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (126 loc) · 5.4 KB
/
build-local.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
name: Local Build
on:
workflow_dispatch:
inputs:
releaseChannel:
type: choice
description: "type of release"
required: true
default: "alpha"
options:
- developer
- alpha
- beta-internal
- beta
- release-internal
- release
workflow_call:
inputs:
releaseChannel:
type: string
required: true
run-name: Local Build - ${{ inputs.releaseChannel }}
jobs:
build-mobile:
name: ${{ matrix.platform }} binaries
if: ${{ always() }}
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: packages/mobile
strategy:
matrix:
platform: [android, ios]
include:
- os: ubuntu-latest
platform: android
- os: macos-latest
platform: ios
fail-fast: false
steps:
- name: Check for EXPO_TOKEN
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
exit 1
fi
working-directory: ./
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.14.*
cache: yarn
cache-dependency-path: "**/yarn.lock"
- name: "[${{ matrix.platform }}] yarn install"
# run: yarn --frozen-lockfile # TODO: --frozen-lockfile is erroring out, saying it must be updated. But it doesn't do that on my local machine. Why does it do that on the Github runner? Both seem to be using the same yarn version, 1.22.19
run: yarn
- name: "[${{ matrix.platform }}] Check for compile errors"
# Note: Running "tsc" at the end of "yarn build" is the relevant part here.
run: yarn build
- name: "[${{ matrix.platform }}] Check if webapp was copied"
id: check-webapp-copied
run: |
if [ -f "assets/web-dist/index.html" ] || [ -e "assets/web-dist/index.html" ]; then
echo "File exists"
echo "file_exists=true" >> $GITHUB_OUTPUT
else
echo "File does not exist"
echo "file_exists=false" >> $GITHUB_OUTPUT
fi
- name: "[${{ matrix.platform }}] Fail if webapp didn't get copied"
if: steps.check-webapp-copied.outputs.file_exists != 'true'
run: |
echo "The file does not exist at assets/web-dist/index.html"
exit 1
- name: "[${{ matrix.platform }}] Setup EAS"
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: "[${{ matrix.platform }}] EAS Local Build"
run: eas build --local --platform ${{ matrix.platform }} --profile ${{ inputs.releaseChannel }} --non-interactive
# If something goes wrong, the following 2 pages are useful guides for understanding the outline of the build process:
# https://docs.expo.dev/build-reference/android-builds/ or https://docs.expo.dev/build-reference/ios-builds/
- name: "[${{ matrix.platform }}] Upload binary"
uses: actions/upload-artifact@v3
with:
name: BloomReaderLite-${{ matrix.platform }}-${{ inputs.releaseChannel }}
path: packages/mobile/build-*
# ENHANCE: You could have it automatically upload to Diawi: https://github.com/marketplace/actions/upload-diawi
build-electron:
name: electron (${{ matrix.platform }}) binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
#platform: [win, mac, unix]
platform: [unix]
include:
# - os: windows-latest
# platform: win
#- os: macos-latest
# platform: mac
- os: ubuntu-latest
platform: unix
defaults:
run:
working-directory: packages/electron-demo
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.14.*
cache: yarn
cache-dependency-path: "packages/electron-demo/yarn.lock"
- name: "[electron] yarn install"
run: yarn
- name: "[electron] Build"
run: yarn build
- name: "[electron] Upload binary"
uses: actions/upload-artifact@v3
with:
name: BloomReaderLite-${{ matrix.platform }}-${{ inputs.releaseChannel }}
path: packages/electron-demo/output/*