forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (99 loc) · 3.57 KB
/
client-android-eas.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
name: Android Client - EAS Build
on:
workflow_dispatch:
inputs:
buildType:
required: true
type: 'choice'
description: 'buildType'
options:
- versioned-client
- unversioned-client
- versioned-client-signed
- versioned-client-signed-apk
- versioned-client-add-sdk
schedule:
# 5:20 AM UTC time on every Monday, Wednesday and Friday
# Build a versioned client
- cron: '20 5 * * 1,3,5'
# 5:20 AM UTC time on every Monday
# Run versioning process for the next sdk and build a versioned client
- cron: '20 5 * * 1'
pull_request:
paths:
- .github/workflows/client-android-eas.yml
- apps/eas-expo-go/**
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: 👀 Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: 🔓 Decrypt secrets if possible
uses: ./.github/actions/expo-git-decrypt
with:
key: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
yarn-tools: 'true'
- name: 🧶 Yarn install
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: Install eas-cli
run: npm install -g eas-cli
- name: 🔎 Check which flavor to build
id: flavor
uses: dorny/paths-filter@v2
with:
# this action fails when base is not set on schedule event
base: ${{ github.ref }}
filters: |
versioned:
- android/versioned-abis/**
- android/versioned-react-native/**
- android/expoview/src/versioned/**
- android/expoview/src/main/java/versioned/**
- android/**/*.gradle
- name: Resolve profile
id: profile
run: |
DISPATCH_PROFILE="${{ github.event.inputs.buildType }}"
IS_VERSIONED="${{ steps.flavor.outputs.versioned }}"
if [[ ! -z "$DISPATCH_PROFILE" ]]; then
echo ::set-output name=profile::"$DISPATCH_PROFILE"
elif [[ "${{ github.event.schedule }}" == "20 5 * * 1,3,5" ]]; then
echo ::set-output name=profile::"versioned-client"
elif [[ "${{ github.event.schedule }}" == "20 5 * * 1" ]]; then
echo ::set-output name=profile::"versioned-client-add-sdk"
elif [[ "$IS_VERSIONED" == "true" ]]; then
echo ::set-output name=profile::"versioned-client"
else
echo ::set-output name=profile::"unversioned-client"
fi
- name: Build
uses: ./.github/actions/eas-build
id: build
with:
platform: 'android'
profile: ${{ steps.profile.outputs.profile }}
projectRoot: './apps/eas-expo-go'
expoToken: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
resourceClass: large
noWait: ${{ github.event.schedule }}
- name: On workflow canceled
if: ${{ cancelled() && steps.build.outputs.build_id }}
run: eas build:cancel ${{ steps.build.outputs.build_id }}
working-directory: ./apps/eas-expo-go
env:
EXPO_TOKEN: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
EAS_BUILD_PROFILE: ${{ steps.profile.outputs.profile }}