Skip to content

Commit 800edbb

Browse files
authored
ci: expo upgrade gh action (react-native-elements#3702)
1 parent f9a565c commit 800edbb

File tree

13 files changed

+114
-46
lines changed

13 files changed

+114
-46
lines changed

.github/actions/install/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
- name: Setup Node.js Env
1313
uses: actions/setup-node@v2
1414
with:
15-
node-version: "16"
15+
node-version: 18
1616
- name: Cache dependencies
1717
uses: actions/cache@v2
1818
id: root_cache

.github/workflows/dist-preview.yml .github/workflows/bleeding-edge-dist-PR.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
name: PR Deploy on comment
1+
name: (manual) PR's Bleeding Edge Version
2+
23
on:
3-
# pull_request_review_comment:
4-
# types:
5-
# - "created"
6-
# issue_comment:
7-
# types: [created]
84
workflow_dispatch:
95
inputs:
106
pr:
@@ -14,8 +10,6 @@ on:
1410

1511
jobs:
1612
preview:
17-
# if: ${{ github.event.inputs.pr }}
18-
# || github.event.issue.pull_request && github.event.comment.body == '/build' && github.actor== 'arpitBhalla'}}
1913
runs-on: ubuntu-latest
2014
steps:
2115
- name: Get PR SHA
@@ -34,10 +28,10 @@ jobs:
3428
- uses: actions/checkout@v2
3529
with:
3630
ref: ${{ steps.sha.outputs.result }}
37-
- name: Git checkout
38-
uses: actions/checkout@v2
31+
3932
- name: Install dependencies
4033
uses: ./.github/actions/install
34+
4135
- name: Build packages
4236
run: yarn build
4337
- name: Config git
@@ -61,6 +55,7 @@ jobs:
6155
if: ${{ success() }}
6256
uses: actions/github-script@v4
6357
with:
58+
github-token: ${{ secrets.RNE_BOT_TOKEN }}
6459
script: |
6560
github.issues.createComment({
6661
issue_number: ${{github.event.inputs.pr}},
@@ -72,6 +67,7 @@ jobs:
7267
if: ${{ failure() }}
7368
uses: actions/github-script@v4
7469
with:
70+
github-token: ${{ secrets.RNE_BOT_TOKEN }}
7571
script: |
7672
github.issues.createComment({
7773
issue_number: ${{github.event.inputs.pr}},

.github/workflows/dist.yml .github/workflows/bleeding-edge-dist.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Bleeding Edge version
2+
23
on:
34
push:
45
branches:
@@ -10,7 +11,7 @@ on:
1011
- ".github/**"
1112
jobs:
1213
checks:
13-
uses: ./.github/workflows/test.yml
14+
uses: ./.github/workflows/ci-checks.yml
1415
build:
1516
needs: checks
1617
runs-on: ubuntu-latest
File renamed without changes.

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Deploy docs
1+
name: docs
22
on:
33
push:
44
branches:

.github/workflows/expo-pr-preview.yml .github/workflows/expo-preview-PR.yml

+31-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
name: Expo Preview PR CI
1+
name: (manual) Expo preview Channel
22

33
on:
4-
pull_request_target:
5-
types: [review_requested]
6-
paths:
7-
- "example/**"
4+
workflow_dispatch:
5+
inputs:
6+
pr:
7+
type: string
8+
description: PR Number
9+
required: true
810

911
jobs:
1012
publish:
@@ -14,34 +16,46 @@ jobs:
1416
working-directory: example
1517
runs-on: ubuntu-latest
1618
steps:
17-
- name: 🏗 Setup repo
18-
uses: actions/checkout@v2
19-
20-
- name: 🏗 Setup Node
21-
uses: actions/setup-node@v2
19+
- name: Get PR SHA
20+
id: sha
21+
uses: actions/github-script@v4
22+
with:
23+
result-encoding: string
24+
script: |
25+
const { owner, repo, } = context.issue;
26+
const pr = await github.pulls.get({
27+
owner,
28+
repo,
29+
pull_number: ${{github.event.inputs.pr}},
30+
});
31+
return pr.data.head.sha
32+
- uses: actions/checkout@v2
2233
with:
23-
node-version: 16.x
34+
ref: ${{ steps.sha.outputs.result }}
35+
36+
- name: Install dependencies
37+
uses: ./.github/actions/install
2438

2539
- name: 🏗 Setup Expo
2640
uses: expo/expo-github-action@v7
2741
with:
2842
expo-version: latest
2943
token: ${{ secrets.EXPO_TOKEN }}
30-
- name: Install dependencies
31-
uses: ./.github/actions/install
44+
3245
- name: 🚀 Publish preview
33-
run: expo publish --release-channel=pr-${{ github.event.number }} --non-interactive
46+
run: expo publish --release-channel=pr-${{ github.event.inputs.pr }} --non-interactive
3447
- name: Find Comment
3548
uses: peter-evans/find-comment@v1
3649
id: fc
3750
with:
38-
issue-number: ${{ github.event.pull_request.number }}
39-
comment-author: "react-native-elements[bot]"
51+
issue-number: ${{ github.event.inputs.pr }}
52+
comment-author: "rneui"
4053
body-includes: Preview published
54+
4155
- name: Create or update comment
4256
uses: peter-evans/create-or-update-comment@v1
4357
env:
44-
QR_PATH: https://qr.expo.dev/expo-go?owner=rne_org&slug=react-native-elements&releaseChannel=pr-${{ github.event.number }}&host=exp.host
58+
QR_PATH: https://qr.expo.dev/expo-go?owner=rneui&slug=react-native-elements&releaseChannel=pr-${{ github.event.number }}&host=exp.host
4559
with:
4660
comment-id: ${{ steps.fc.outputs.comment-id }}
4761
issue-number: ${{ github.event.pull_request.number }}

.github/workflows/expo.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Expo Default Channel Preview CI
1+
name: (manual) Expo default Channel
22

33
on: workflow_dispatch
44

@@ -11,21 +11,15 @@ jobs:
1111
- name: 🏗 Setup repo
1212
uses: actions/checkout@v2
1313

14-
- name: 🏗 Setup Node
15-
uses: actions/setup-node@v2
16-
with:
17-
node-version: 16.x
18-
cache: yarn
14+
- name: Install dependencies
15+
uses: ./.github/actions/install
1916

2017
- name: 🏗 Setup Expo
2118
uses: expo/expo-github-action@v7
2219
with:
2320
expo-version: latest
2421
token: ${{ secrets.EXPO_TOKEN }}
2522

26-
- name: Install dependencies
27-
uses: ./.github/actions/install
28-
2923
- name: 🚀 Publish preview
3024
run: |
3125
cd example
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: (manual) Upgrade expo SDK
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish:
8+
continue-on-error: true
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: 🏗 Setup repo
13+
uses: actions/checkout@v2
14+
15+
- name: Install dependencies
16+
uses: ./.github/actions/install
17+
18+
- name: Set env
19+
run: |
20+
BRANCH_NAME="upgrade-expo-sdk-$(date "+%Y%m%d%H%M%S")"
21+
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
22+
23+
- name: Upgrade Expo
24+
working-directory: example
25+
run: |
26+
npm --global install expo-cli@latest
27+
npx expo upgrade --non-interactive
28+
29+
- name: Config git
30+
run: |
31+
git config --local user.email "[email protected]"
32+
git config --local user.name "RNEUI"
33+
34+
- name: Checkout
35+
run: |
36+
git add .
37+
git commit -m "Upgrade Expo SDK"
38+
git checkout -b ${{ env.BRANCH_NAME }}
39+
git push --set-upstream origin ${{ env.BRANCH_NAME }} --force
40+
41+
- name: Create Pull Request
42+
continue-on-error: true
43+
uses: actions/github-script@v6
44+
with:
45+
script: |
46+
const { repo, owner } = context.repo;
47+
const result = await github.rest.pulls.create({
48+
title: '[Example] Simple demo',
49+
owner,
50+
repo,
51+
head: '${{ env.BRANCH_NAME }}',
52+
base: 'next',
53+
body: [
54+
'This PR is auto-generated by',
55+
'[actions/github-script](https://github.com/actions/github-script).'
56+
].join('\n')
57+
});
58+
github.rest.issues.addLabels({
59+
owner,
60+
repo,
61+
issue_number: result.data.number,
62+
labels: ['feature', 'automated pr', 'need-review']
63+
});

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Cross Platform <a href="https://reactnative.dev">React Native</a> UI Toolkit
3535

3636
<div align="center">
3737

38-
<a href="https://reactnativeelements.com">Getting Started 🚀</a> - <a href="https://reactnativeelements.com/docs">Documentation 📚</a> - <a href="https://expo.dev/@rne_org/react-native-elements">Expo demo </a> - <a href="https://reactnativeelements.com/blog">Blog</a> - <a href="https://github.com/react-native-elements/react-native-elements/releases">Releases</a>
38+
<a href="https://reactnativeelements.com">Getting Started 🚀</a> - <a href="https://reactnativeelements.com/docs">Documentation 📚</a> - <a href="https://expo.dev/@rneui/react-native-elements">Expo demo </a> - <a href="https://reactnativeelements.com/blog">Blog</a> - <a href="https://github.com/react-native-elements/react-native-elements/releases">Releases</a>
3939

4040
</div>
4141

@@ -80,7 +80,7 @@ Click [here](https://reactnativeelements.com/blog/2018/12/13/react-native-web) f
8080
## Expo demo app
8181

8282
Checkout the official
83-
[React Native Elements App](https://expo.dev/@rne_org/react-native-elements)
83+
[React Native Elements App](https://expo.dev/@rneui/react-native-elements)
8484
on Expo which uses all of the React Native Elements components.
8585

8686
If you are looking to contribute to the React Native Elements App,

example/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# React Native Elements App
44

5-
**[Mobile App](https://expo.dev/@rne_org/react-native-elements)**
5+
**[Mobile App](https://expo.dev/@rneui/react-native-elements)**
66

7-
This is the Demo app for [React Native Elements](https://expo.dev/@rne_org/react-native-elements) built with [Expo](https://expo.io/). The purpose of this app is to demonstrate the usage of the various UI components that React Native Elements provides out of the box.
7+
This is the Demo app for [React Native Elements](https://expo.dev/@rneui/react-native-elements) built with [Expo](https://expo.io/). The purpose of this app is to demonstrate the usage of the various UI components that React Native Elements provides out of the box.
88

99
This app also works on the `web` platform using [React Native Web](https://github.com/necolas/react-native-web). If you are looking to build a React Native mobile app which can reuse the code to deploy it on the web, this is the right place to begin. We decided to use [Expo](https://expo.io/), which reduces the effort required to build an app once and deploy it anywhere.
1010

example/app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"expo": {
33
"name": "React Native Elements",
4-
"owner": "rne_org",
4+
"owner": "rneui",
55
"slug": "react-native-elements",
66
"description": "A demo app for React Native Elements UI Library",
77
"privacy": "public",

website/src/components/RunOnExpo.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const Home: React.FunctionComponent<{}> = () => {
4040
className={
4141
'button button--secondary button--outline button--sm margin-horiz--sm margin-vert--sm'
4242
}
43-
to={'https://expo.dev/@rne_org/react-native-elements'}
43+
to={'https://expo.dev/@rneui/react-native-elements'}
4444
>
4545
Run on Expo Go
4646
</Link>

website/static/img/website/expo-go-qr.svg

+1-1
Loading

0 commit comments

Comments
 (0)