Skip to content

Commit 04692c3

Browse files
committed
feature!: add support for eas cli installs (#98)
* feature!: add support for eas cli installs * refactor: update the action metadata * docs: update documentation to include eas examples * fix: breaking change detection for semantic release * docs: add notion about latest eas version BREAKING CHANGE: Github Action inputs are changed to allow both Expo and EAS CLI.
1 parent 1b57c37 commit 04692c3

13 files changed

Lines changed: 586 additions & 286 deletions

File tree

.releaserc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ module.exports = {
1616
plugins: [
1717
['@semantic-release/commit-analyzer', {
1818
preset: 'conventionalcommits',
19-
releaseRules: rules.map(({ type, release }) => ({ type, release })),
19+
releaseRules: [
20+
{ breaking: true, release: 'major' },
21+
{ revert: true, release: 'patch' },
22+
].concat(
23+
rules.map(({ type, release, breaking }) => ({ type, release, breaking }))
24+
),
2025
}],
2126
['@semantic-release/release-notes-generator', {
2227
preset: 'conventionalcommits',

README.md

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
## What's inside?
3030

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

@@ -37,38 +37,40 @@ There are some additional features included to make the usage of this action as
3737
This action is customizable through variables; they are defined in the [`action.yml`](action.yml).
3838
Here is a summary of all the variables that you can use and their purpose.
3939

40-
variable | default | description
41-
--- | --- | ---
42-
`expo-username` | - | The username of your Expo account _(e.g. `bycedric`)_
43-
`expo-token` | - | The token of your Expo account _(e.g. [`${{ secrets.EXPO_TOKEN }}`][link-actions-secrets])_
44-
`expo-password` | - | The password of your Expo account _(e.g. [`${{ secrets.EXPO_CLI_PASSWORD }}`][link-actions-secrets])_
45-
`expo-version` | `latest` | The Expo CLI version to use, can be any [SemVer][link-semver-playground]. _(e.g. `3.x`)_
46-
`expo-packager` | `yarn` | The package manager to install the CLI with. _(e.g. `npm`)_
47-
`expo-cache` | `false` | If it should use the [GitHub actions (remote) cache](#using-the-built-in-cache).
48-
`expo-cache-key` | - | An optional custom (remote) cache key. _(**use with caution**)_
49-
`expo-patch-watchers` | `true` | If it should [patch the `fs.inotify.` limits](#enospc-errors-on-linux).
40+
| variable | default | description |
41+
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
42+
| `expo-version` | - | [Expo CLI](https://github.com/expo/expo-cli) version to install, skips when omitted. |
43+
| `expo-cache` | `false` | If it should use the [GitHub actions (remote) cache](#using-the-built-in-cache). |
44+
| `expo-cache-key` | - | An optional custom (remote) cache key. _(**use with caution**)_ |
45+
| `eas-version` | - | [EAS CLI](https://github.com/expo/eas-cli) version to install, skips when omitted. (`latest` is recommended) |
46+
| `eas-cache` | `false` | If it should use the [GitHub actions (remote) cache](#using-the-built-in-cache). |
47+
| `eas-cache-key` | - | An optional custom (remote) cache key. _(**use with caution**)_ |
48+
| `packager` | `yarn` | The package manager to use. _(e.g. `npm`)_ |
49+
| `token` | - | The token of your Expo account _(e.g. [`${{ secrets.EXPO_TOKEN }}`][link-actions-secrets])_ |
50+
| `username` | - | The username of your Expo account _(e.g. `bycedric`)_ |
51+
| `password` | - | The password of your Expo account _(e.g. [`${{ secrets.EXPO_CLI_PASSWORD }}`][link-actions-secrets])_ |
52+
| `patch-watchers` | `true` | If it should [patch the `fs.inotify.` limits](#enospc-errors-on-linux). |
5053

5154
> Never hardcode `expo-token` or `expo-password` in your workflow, use [secrets][link-actions-secrets] to store them.
5255
53-
> It's also recommended to set the `expo-version` to avoid breaking changes when a new major version is released.
54-
5556
## Example workflows
5657

5758
Before you dive into the workflow examples, you should know the basics of GitHub Actions.
5859
You can read more about this in the [GitHub Actions documentation][link-actions].
5960

6061
1. [Publish on any push to master](#publish-on-any-push-to-master)
6162
2. [Cache Expo CLI for other jobs](#cache-expo-cli-for-other-jobs)
62-
3. [Test PRs and publish a review version](#test-prs-and-publish-a-review-version)
63-
4. [Test PRs on multiple nodes and systems](#test-prs-on-multiple-nodes-and-systems)
64-
5. [Test and build web every day at 08:00](#test-and-build-web-every-day-at-0800)
65-
6. [Authenticate using an Expo token](#authenticate-using-an-expo-token)
63+
3. [Creating a new EAS build](#publish-on-any-push-to-master)
64+
4. [Test PRs and publish a review version](#test-prs-and-publish-a-review-version)
65+
5. [Test PRs on multiple nodes and systems](#test-prs-on-multiple-nodes-and-systems)
66+
6. [Test and build web every day at 08:00](#test-and-build-web-every-day-at-0800)
67+
7. [Authenticate using credentials](#authenticate-using-credentials)
6668

6769
### Publish on any push to master
6870

6971
Below you can see the example configuration to publish whenever the master branch is updated.
7072
The workflow listens to the `push` event and sets up Node 12 using the [Setup Node Action][link-actions-node].
71-
It also authenticates the Expo project by defining both `expo-username` and `expo-password`.
73+
It also auto-authenticates when the `token` is provided.
7274

7375
```yml
7476
name: Expo Publish
@@ -88,8 +90,7 @@ jobs:
8890
- uses: expo/expo-github-action@v5
8991
with:
9092
expo-version: 4.x
91-
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
92-
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
93+
token: ${{ secrets.EXPO_TOKEN }}
9394
- run: yarn install
9495
- run: expo publish
9596
```
@@ -120,13 +121,43 @@ jobs:
120121
- uses: expo/expo-github-action@v5
121122
with:
122123
expo-version: 4.x
123-
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
124-
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
125124
expo-cache: true
125+
token: ${{ secrets.EXPO_TOKEN }}
126126
- run: yarn install
127127
- run: expo publish
128128
```
129129
130+
### Creating a new EAS build
131+
132+
You can also install [EAS](https://docs.expo.io/eas/) CLI with this Github Action.
133+
Below we've swapped `expo-version` with `eas-version`, but you can also use them together.
134+
Both the `token` and `username`/`password` is shared between both Expo and EAS CLI.
135+
136+
> We recommend using `latest` for `eas-version` to always have the most up-to-date version.
137+
138+
```yml
139+
name: EAS build
140+
on:
141+
push:
142+
branches:
143+
- master
144+
jobs:
145+
build:
146+
name: Create new build
147+
runs-on: ubuntu-latest
148+
steps:
149+
- uses: actions/checkout@v2
150+
- uses: actions/setup-node@v1
151+
with:
152+
node-version: 14.x
153+
- uses: expo/expo-github-action@v5
154+
with:
155+
eas-version: latest
156+
token: ${{ secrets.EXPO_TOKEN }}
157+
- run: yarn install
158+
- run: eas build
159+
```
160+
130161
### Test PRs and publish a review version
131162

132163
Reviewing pull requests can take some time if you have to read every line of code.
@@ -148,8 +179,7 @@ jobs:
148179
- uses: expo/expo-github-action@v5
149180
with:
150181
expo-version: 4.x
151-
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
152-
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
182+
token: ${{ secrets.EXPO_TOKEN }}
153183
- run: yarn install
154184
- run: expo publish --release-channel=pr-${{ github.event.number }}
155185
- uses: unsplash/comment-on-pr@master
@@ -164,7 +194,7 @@ jobs:
164194
With GitHub Actions, it's reasonably easy to set up a matrix build and test the app on multiple environments.
165195
These matrixes can help to make sure your app runs smoothly on a broad set of different development machines.
166196

167-
> If you don't need automatic authentication, you can omit the `expo-username` and `expo-password` variables.
197+
> If you don't need automatic authentication, you can omit the `token` variables.
168198

169199
```yml
170200
name: Expo CI
@@ -217,10 +247,10 @@ jobs:
217247
- run: expo build:web
218248
```
219249

220-
### Authenticate using an Expo token
250+
### Authenticate using credentials
221251

222-
Instead of username and password, you can also authenticate using a token.
223-
This might help increasing security and avoids adding username and password to your repository secrets.
252+
Instead of using an access token, you can also authenticate using credentials.
253+
This is only possible when Expo CLI is installed.
224254

225255
```yml
226256
name: Expo Publish
@@ -240,7 +270,8 @@ jobs:
240270
- uses: expo/expo-github-action@v5
241271
with:
242272
expo-version: 4.x
243-
expo-token: ${{ secrets.EXPO_TOKEN }}
273+
username: ${{ secrets.EXPO_CLI_USERNAME }}
274+
password: ${{ secrets.EXPO_CLI_PASSWORD }}
244275
- run: yarn install
245276
- run: expo publish
246277
```
@@ -263,7 +294,7 @@ Under the hood, it uses the [`@action/cache`][link-actions-cache-package] packag
263294
This action generates a unique cache key for the OS, used packager, and exact version of the Expo CLI.
264295
If you need more control over this cache, you can define a custom cache key with `expo-cache-key`.
265296

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

268299
### ENOSPC errors on Linux
269300

@@ -272,7 +303,7 @@ Creating these bundles require quite some resources.
272303
As of writing, GitHub actions has some small default values for the `fs.inotify` settings.
273304
Inside this action, we included a patch that increases these limits for the current workflow.
274305
It increases the `max_user_instances`, `max_user_watches` and `max_queued_events` to `524288`.
275-
You can disable this patch by setting the `expo-patch-watchers` to `false`.
306+
You can disable this patch by setting the `patch-watchers` to `false`.
276307

277308
<div align="center">
278309
<br />
@@ -288,4 +319,5 @@ You can disable this patch by setting the `expo-patch-watchers` to `false`.
288319
[link-expo-cli]: https://docs.expo.io/workflow/expo-cli/
289320
[link-expo-cli-password]: https://github.com/expo/expo-cli/blob/master/packages/expo-cli/src/accounts.ts#L88-L90
290321
[link-expo-release-channels]: https://docs.expo.io/distribution/release-channels/
322+
[link-eas-cli]: https://github.com/expo/eas-cli#readme
291323
[link-semver-playground]: https://semver.npmjs.com/

action.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,28 @@ runs:
1010
main: build/index.js
1111
inputs:
1212
expo-version:
13-
description: The Expo CLI version to install. (use any semver/dist-tag available)
14-
default: latest
15-
expo-username:
13+
description: The Expo CLI version to install (use any semver/dist-tag available).
14+
expo-cache:
15+
description: If Expo CLI should be stored in the GitHub Actions cache.
16+
default: false
17+
expo-cache-key:
18+
description: A custom remote cache key to use for Expo CLI.
19+
eas-version:
20+
description: The EAS CLI version to install (use any semver/dist-tag available).
21+
eas-cache:
22+
description: If EAS CLI should be stored in the GitHub Actions cache.
23+
default: false
24+
eas-cache-key:
25+
description: A custom remote cache key to use for EAS CLI.
26+
username:
1627
description: Your Expo username, for authentication.
17-
expo-token:
28+
token:
1829
description: Your Expo token, for authentication. (use with secrets)
19-
expo-password:
30+
password:
2031
description: Your Expo password, for authentication. (use with secrets)
21-
expo-packager:
32+
packager:
2233
description: The package manager used to install the Expo CLI. (can be yarn or npm)
2334
default: yarn
24-
expo-patch-watchers:
35+
patch-watchers:
2536
description: If Expo should fix the default watchers limit, helps with ENOSPC errors. (can be true or false)
2637
default: true
27-
expo-cache:
28-
description: If Expo should be stored in the GitHub Actions cache (can be true or false)
29-
default: false
30-
expo-cache-key:
31-
description: A custom remote cache key to use (best to let GitHub Actions handle it)

0 commit comments

Comments
 (0)