forked from react-native-elements/react-native-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 2.03 KB
/
expo-preview-PR.yml
File metadata and controls
66 lines (59 loc) · 2.03 KB
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
name: (manual) PR's Expo preview Channel
on:
workflow_dispatch:
inputs:
pr:
type: string
description: PR Number
required: true
jobs:
publish:
continue-on-error: true
defaults:
run:
working-directory: example
runs-on: ubuntu-latest
steps:
- name: Get PR SHA
id: sha
uses: actions/github-script@v4
with:
result-encoding: string
script: |
const { owner, repo, } = context.issue;
const pr = await github.pulls.get({
owner,
repo,
pull_number: ${{github.event.inputs.pr}},
});
return pr.data.head.sha
- uses: actions/checkout@v2
with:
ref: ${{ steps.sha.outputs.result }}
- name: Install dependencies
uses: ./.github/actions/install
- name: 🏗 Setup Expo
uses: expo/expo-github-action@v7
with:
expo-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 🚀 Publish preview
run: expo publish --release-channel=pr-${{ github.event.inputs.pr }} --non-interactive
- name: Find Comment
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.inputs.pr }}
comment-author: "rneui"
body-includes: Preview published
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v1
env:
QR_PATH: https://qr.expo.dev/expo-go?owner=rneui&slug=react-native-elements&releaseChannel=pr-${{ github.event.number }}&host=exp.host
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Preview published
The mobile version of example app from this branch is ready! You can [see it here](${{ env.QR_PATH }})<br><br><a href="${{ env.QR_PATH }}"><img src="${{env.QR_PATH}}" height="200px" width="200px"></a>.
edit-mode: replace