-
Notifications
You must be signed in to change notification settings - Fork 17
74 lines (63 loc) · 2.49 KB
/
preview.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
name: Preview
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release type'
required: true
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
preview:
name: Preview
runs-on: macos-latest
permissions:
pull-requests: write
contents: write
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
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Create env file
run: |
echo "${{ secrets.ENV_FILE_COMMON }}" > .env.common
echo "${{ secrets.ENV_FILE_DEVELOPMENT }}" > .env.development
echo "${{ secrets.ENV_FILE_PRODUCTION }}" > .env.production
echo "${{ secrets.ENV_FILE_TEST }}" > .env.test
echo "${{ secrets.ANDROID_GOOGLE_SERVICES_DEVELOPMENT }}" > google-services.development.json
echo "${{ secrets.ANDROID_GOOGLE_SERVICES_TEST }}" > google-services.test.json
echo "${{ secrets.ANDROID_GOOGLE_SERVICES_PRODUCTION }}" > google-services.production.json
echo "${{ secrets.IOS_GOOGLE_SERVICES_DEVELOPMENT }}" > GoogleService-Info.development.plist
echo "${{ secrets.IOS_GOOGLE_SERVICES_TEST }}" > GoogleService-Info.test.plist
echo "${{ secrets.IOS_GOOGLE_SERVICES_PRODUCTION }}" > GoogleService-Info.production.plist
- name: Install Dependencies
run: yarn
- name: Create Release Pull Request
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_TYPE=${{ github.event.inputs.release_type }}
echo "Release type: $RELEASE_TYPE"
yarn changeset version
if [ "$RELEASE_TYPE" == "patch" ]; then
yarn run update:preview
elif [ "$RELEASE_TYPE" == "minor" ] || [ "$RELEASE_TYPE" == "major" ]; then
yarn run build:preview -p all
else
echo "No release type detected"
fi