-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 2.57 KB
/
publish-pr.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
name: Test and publish Pull Request
on:
pull_request:
branches:
- main
- beta
env:
node-version: 12
expo-version: 4.x
jobs:
publish:
name: Test and publish
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Increase watchers to fix Docker
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.node-version }}
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn dependencies
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: Install dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 5
retry_on: error
command: yarn install --prefer-offline --frozen-lockfile --silent
- name: Start linter
run: yarn lint
- name: Start typescript check
run: yarn typecheck
- name: Start test
run: yarn test --silent --onlyChanged
- name: Install Expo
uses: expo/expo-github-action@v5
with:
expo-packager: yarn
expo-version: ${{ env.expo-version }}
expo-token: ${{ secrets.EXPO_TOKEN }}
expo-cache: true
- name: Start expo doctor check
run: yarn doctor
- name: Expo publish PR at own channel
run: expo publish --non-interactive --release-channel pr${{ github.event.number }}
- name: Comment PR
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: `${{ env.BODY }}` });
env:
BODY: |
## App is ready for review
Published to https://exp.host/@diogoabu/how-much?release-channel=pr${{ github.event.number }}
[![Expo QR](https://api.qrserver.com/v1/create-qr-code/?size=160x160&data=exp://exp.host/@diogoabu/how-much?release-channel=pr${{ github.event.number }})](https://exp.host/@diogoabu/how-much?release-channel=pr${{ github.event.number }})