Skip to content

Commit 521de72

Browse files
committed
docs: update readme and contributing guides
1 parent 633cdf0 commit 521de72

3 files changed

Lines changed: 41 additions & 142 deletions

File tree

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
## 🏎️ Running a custom version
1212

13-
To try out your changed with GitHub Action, you have [to reference your fork and/or branch or commit reference](https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions#using-release-management-for-your-custom-actions) in the workflow you want to try. After that, you have two options:
13+
To try out your changes with GitHub Action, you have [to reference your fork and/or branch or commit reference](https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions#using-release-management-for-your-custom-actions) in the workflow you want to try. After that, you have two options:
1414

1515
1. Run the workflow in GitHub Actions itself by triggering your workflow.
1616
2. Run the workflow locally with [nektos/act](https://github.com/nektos/act).
1717

18-
## Testing
18+
## 🧪 Testing
1919

2020
Testing is done using [Jest](https://jestjs.io/https://jestjs.io/). Run `yarn test` to run Jest.
2121

22-
In CI we are running tests on multiple Node versions using Windows, Linux, and MacOS. Make sure they are passing for your PR.
22+
If your PR is ready, run the **test** workflow to test the workflows on all supported OS system.
2323

2424
## 📝 Writing a Commit Message
2525

README.md

Lines changed: 37 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,26 @@
2525

2626
## What's inside?
2727

28-
With this Expo action, you have full access to [Expo CLI][link-expo-cli] and [EAS CLI][link-eas-cli] itself.
29-
It allows you to fully automate the `expo publish` or `expo build` process, leaving you with more time available for your project.
28+
With this Expo action, you have full access to [Expo CLI][link-expo-cli] and [EAS CLI][link-eas-cli].
29+
It allows you to fully automate the `expo publish` or `eas build` process, leaving you with more time available for your project.
3030
There are some additional features included to make the usage of this action as simple as possible, like caching and authentication.
3131

3232
## Configuration options
3333

3434
This action is customizable through variables; they are defined in the [`action.yml`](action.yml).
3535
Here is a summary of all the variables that you can use and their purpose.
3636

37-
| variable | default | description |
38-
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
39-
| `expo-version` | - | [Expo CLI](https://github.com/expo/expo-cli) version to install, skips when omitted. |
40-
| `expo-cache` | `false` | If it should use the [GitHub actions (remote) cache](#using-the-built-in-cache). |
41-
| `expo-cache-key` | - | An optional custom (remote) cache key. _(**use with caution**)_ |
42-
| `eas-version` | - | [EAS CLI](https://github.com/expo/eas-cli) version to install, skips when omitted. (`latest` is recommended) |
43-
| `eas-cache` | `false` | If it should use the [GitHub actions (remote) cache](#using-the-built-in-cache). |
44-
| `eas-cache-key` | - | An optional custom (remote) cache key. _(**use with caution**)_ |
45-
| `packager` | `yarn` | The package manager to use. _(e.g. `npm`)_ |
46-
| `token` | - | The token of your Expo account _(e.g. [`${{ secrets.EXPO_TOKEN }}`][link-actions-secrets])_ |
47-
| `username` | - | The username of your Expo account _(e.g. `bycedric`)_ |
48-
| `password` | - | The password of your Expo account _(e.g. [`${{ secrets.EXPO_CLI_PASSWORD }}`][link-actions-secrets])_ |
49-
| `patch-watchers` | `true` | If it should [patch the `fs.inotify.` limits](#enospc-errors-on-linux). |
50-
51-
> Never hardcode `expo-token` or `expo-password` in your workflow, use [secrets][link-actions-secrets] to store them.
37+
| variable | default | description |
38+
| ---------------- | ------- | ------------------------------------------------------------------------------------ |
39+
| `expo-version` | `''` | [Expo CLI](https://github.com/expo/expo-cli) version to install, skips when omitted. |
40+
| `expo-cache` | `false` | If it should use the [GitHub actions cache](#using-the-built-in-cache). |
41+
| `eas-version` | `''` | [EAS CLI](https://github.com/expo/eas-cli) version to install, skips when omitted. |
42+
| `eas-cache` | `false` | If it should use the [GitHub actions cache](#using-the-built-in-cache). |
43+
| `packager` | `yarn` | The package manager to use. _(e.g. `yarn` or `npm`)_ |
44+
| `token` | `''` | The token of your Expo account |
45+
| `patch-watchers` | `true` | If it should [patch the `fs.inotify.` limits](#enospc-errors-on-linux). |
46+
47+
> Never hardcode `expo-token` in your workflow, use [secrets][link-actions-secrets] to store them.
5248
5349
> Using `latest` for `eas-version` is recommened, you should always have the latest version of this CLI installed.
5450
@@ -58,12 +54,9 @@ Before you dive into the workflow examples, you should know the basics of GitHub
5854
You can read more about this in the [GitHub Actions documentation][link-actions].
5955

6056
1. [Publish on any push to main](#publish-on-any-push-to-main)
61-
2. [Cache Expo CLI for other jobs](#cache-expo-cli-for-other-jobs)
62-
3. [Creating a new EAS build](#creating-a-new-eas-build)
63-
4. [Test PRs and publish a review version](#test-prs-and-publish-a-review-version)
64-
5. [Test PRs on multiple nodes and systems](#test-prs-on-multiple-nodes-and-systems)
65-
6. [Test and build web every day at 08:00](#test-and-build-web-every-day-at-0800)
66-
7. [Authenticate using credentials](#authenticate-using-credentials)
57+
2. [Creating a new EAS build](#creating-a-new-eas-build)
58+
3. [Test PRs and publish a review version](#test-prs-and-publish-a-review-version)
59+
4. [Test PRs on multiple nodes and systems](#test-prs-on-multiple-node-versions-and-systems)
6760

6861
### Publish on any push to main
6962

@@ -72,55 +65,22 @@ The workflow listens to the `push` event and sets up Node 14 using the [Setup No
7265
It also auto-authenticates when the `token` is provided.
7366

7467
```yml
75-
name: Expo Publish
76-
on:
77-
push:
78-
branches:
79-
- main
80-
jobs:
81-
publish:
82-
name: Install and publish
83-
runs-on: ubuntu-latest
84-
steps:
85-
- uses: actions/checkout@v2
86-
- uses: actions/setup-node@v2
87-
with:
88-
node-version: 14.x
89-
- uses: expo/expo-github-action@v6
90-
with:
91-
expo-version: 4.x
92-
token: ${{ secrets.EXPO_TOKEN }}
93-
- run: yarn install
94-
- run: expo publish
95-
```
96-
97-
### Cache Expo CLI for other jobs
98-
99-
Below you can see a slightly modified version of the example above.
100-
In this one, we enabled the built-in cache that will reuse a previously installed Expo CLI.
101-
It skips the installation part and extracts the files directly, boosting the performance of your workflow.
102-
103-
> You can [read more about the cache here](#using-the-built-in-cache)
104-
105-
```yml
106-
name: Expo Publish
10768
on:
10869
push:
10970
branches:
11071
- main
11172
jobs:
11273
publish:
113-
name: Install and publish
11474
runs-on: ubuntu-latest
11575
steps:
11676
- uses: actions/checkout@v2
11777
- uses: actions/setup-node@v2
11878
with:
119-
node-version: 14.x
79+
node-version: 16.x
80+
cache: yarn
12081
- uses: expo/expo-github-action@v6
12182
with:
122-
expo-version: 4.x
123-
expo-cache: true
83+
expo-version: 5.x
12484
token: ${{ secrets.EXPO_TOKEN }}
12585
- run: yarn install
12686
- run: expo publish
@@ -135,20 +95,19 @@ Both the `token` and `username`/`password` is shared between both Expo and EAS C
13595
> We recommend using `latest` for `eas-version` to always have the most up-to-date version.
13696

13797
```yml
138-
name: EAS build
13998
on:
14099
push:
141100
branches:
142101
- main
143102
jobs:
144103
build:
145-
name: Create new build
146104
runs-on: ubuntu-latest
147105
steps:
148106
- uses: actions/checkout@v2
149107
- uses: actions/setup-node@v2
150108
with:
151-
node-version: 14.x
109+
node-version: 16.x
110+
cache: yarn
152111
- uses: expo/expo-github-action@v6
153112
with:
154113
eas-version: latest
@@ -164,134 +123,76 @@ To make this easier, you can publish the edited version of the PR using a [relea
164123
Below you can see an example of a workflow that publishes and comments on te PR when the app is published.
165124

166125
```yml
167-
name: Expo Review
168126
on: [pull_request]
127+
env:
128+
projectOwner: bycedric
129+
projectSlug: use-expo
169130
jobs:
170131
publish:
171-
name: Install and publish
172132
runs-on: ubuntu-latest
173133
steps:
174134
- uses: actions/checkout@v2
175135
- uses: actions/setup-node@v2
176136
with:
177-
node-version: 14.x
137+
node-version: 16.x
138+
cache: yarn
178139
- uses: expo/expo-github-action@v6
179140
with:
180-
expo-version: 4.x
141+
expo-version: 5.x
181142
token: ${{ secrets.EXPO_TOKEN }}
182143
- run: yarn install
183144
- run: expo publish --release-channel=pr-${{ github.event.number }}
184-
- uses: unsplash/comment-on-pr@master
145+
- uses: unsplash/comment-on-pr@v1.1.1
185146
env:
186147
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
187148
with:
188-
msg: App is ready for review, you can [see it here](https://expo.dev/@bycedric/use-expo?release-channel=pr-${{ github.event.number }}).
149+
msg: App is ready for review, you can [see it here](https://expo.dev/@${{ env.projectOwner }}/${{ env.projectSlug }}?release-channel=pr-${{ github.event.number }}).\n\n<img src="https://qr.expo.dev/expo-go?owner=${{ env.projectOwner }}&slug=${{ env.projectSlug }}&releaseChannel=pr-${{ github.event.number }}" height="200px" width="200px"></a>
189150
```
190151

191-
### Test PRs on multiple nodes and systems
152+
### Test PRs on multiple node versions and systems
192153

193154
With GitHub Actions, it's reasonably easy to set up a matrix build and test the app on multiple environments.
194155
These matrixes can help to make sure your app runs smoothly on a broad set of different development machines.
195156

196157
> If you don't need automatic authentication, you can omit the `token` variables.
197158

198159
```yml
199-
name: Expo CI
200160
on: [pull_request]
201161
jobs:
202162
ci:
203-
name: Continuous Integration
204163
runs-on: ${{ matrix.os }}
205164
strategy:
206165
matrix:
207166
os: [ubuntu-latest, macOS-latest, windows-latest]
208-
node: [10, 12, 13]
167+
node: [14.x, 16.x]
209168
steps:
210169
- uses: actions/checkout@v2
211170
- uses: actions/setup-node@v2
212171
with:
213172
node-version: ${{ matrix.node }}
173+
cache: yarn
214174
- uses: expo/expo-github-action@v6
215175
with:
216-
expo-version: 4.x
176+
expo-version: 5.x
217177
- run: yarn install
218178
- run: yarn test
219179
- run: expo doctor
220180
```
221181

222-
### Test and build web every day at 08:00
223-
224-
You can also schedule jobs by using the cron syntax.
225-
It can help to minimize the number of updates your users have to install.
226-
227-
```yml
228-
name: Expo Daily CI
229-
on:
230-
schedule:
231-
- cron: 0 8 * * *
232-
jobs:
233-
ci:
234-
name: Daily Continuous Integration
235-
runs-on: ubuntu-latest
236-
steps:
237-
- uses: actions/checkout@v2
238-
- uses: actions/setup-node@v2
239-
with:
240-
node-version: 14.x
241-
- uses: expo/expo-github-action@v6
242-
with:
243-
expo-version: 4.x
244-
- run: yarn install
245-
- run: yarn test
246-
- run: expo build:web
247-
```
248-
249-
### Authenticate using credentials
250-
251-
Instead of using an access token, you can also authenticate using credentials.
252-
This is only possible when Expo CLI is installed.
253-
254-
```yml
255-
name: Expo Publish
256-
on:
257-
push:
258-
branches:
259-
- main
260-
jobs:
261-
publish:
262-
name: Install and publish
263-
runs-on: ubuntu-latest
264-
steps:
265-
- uses: actions/checkout@v2
266-
- uses: actions/setup-node@v2
267-
with:
268-
node-version: 14.x
269-
- uses: expo/expo-github-action@v6
270-
with:
271-
expo-version: 4.x
272-
username: ${{ secrets.EXPO_CLI_USERNAME }}
273-
password: ${{ secrets.EXPO_CLI_PASSWORD }}
274-
- run: yarn install
275-
- run: expo publish
276-
```
277-
278182
## Things to know
279183

280184
### Automatic Expo login
281185

282186
You need to authenticate for some Expo commands like `expo publish` and `expo build`.
283-
This action gives you configuration options to keep your workflow simple.
284-
You can choose if you want to authenticate using an `EXPO_TOKEN` or account credentials.
285-
Under the hood, it uses the [`EXPO_CLI_PASSWORD`][link-expo-cli-password] environment variable to make credentials authentication as secure as possible.
187+
This action can export the `EXPO_TOKEN` variable to access it in every step.
286188

287-
> Note, this action only uses your token or credentials to authenticate with Expo. It doesn't store these anywhere.
189+
> Note, this action does not store the token anywhere. For every seperate job, you need to setup the token.
288190

289191
### Using the built-in cache
290192

291193
You can opt-in to caching the installation, making it a lot faster.
292-
Under the hood, it uses the [`@action/cache`][link-actions-cache-package] package to restore the Expo CLI installation.
194+
Under the hood, it uses the [`@actions/cache`][link-actions-cache-package] package to restore the Expo CLI installation.
293195
This action generates a unique cache key for the OS, used packager, and exact version of the Expo CLI.
294-
If you need more control over this cache, you can define a custom cache key with `expo-cache-key`.
295196

296197
> Note, this cache will count towards your [repo cache limit][link-actions-cache-limit]. The Expo and EAS CLI are stored in different caches.
297198

@@ -312,11 +213,9 @@ You can disable this patch by setting the `patch-watchers` to `false`.
312213

313214
[link-actions]: https://help.github.com/en/categories/automating-your-workflow-with-github-actions
314215
[link-actions-cache-limit]: https://github.com/actions/cache#cache-limits
315-
[link-actions-cache-package]: https://www.npmjs.com/package/@actions/cache
216+
[link-actions-cache-package]: https://github.com/actions/toolkit/tree/main/packages/cache
316217
[link-actions-node]: https://github.com/actions/setup-node
317218
[link-actions-secrets]: https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
318219
[link-expo-cli]: https://docs.expo.dev/workflow/expo-cli/
319-
[link-expo-cli-password]: https://github.com/expo/expo-cli/blob/master/packages/expo-cli/src/accounts.ts#L88-L90
320220
[link-expo-release-channels]: https://docs.expo.dev/distribution/release-channels/
321221
[link-eas-cli]: https://github.com/expo/eas-cli#readme
322-
[link-semver-playground]: https://semver.npmjs.com/

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Expo GitHub Action
33
author: Cedric van Putten <me@bycedric.com>
4-
description: Expo and EAS in GitHub Actions
4+
description: Publish, build or manage your Expo app with GitHub Actions
55
branding:
66
icon: terminal
77
color: gray-dark

0 commit comments

Comments
 (0)