-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into expo-sdk-50
- Loading branch information
Showing
4 changed files
with
130 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Build and submit | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-submit: | ||
name: Build and submit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for EXPO_TOKEN | ||
run: | | ||
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then | ||
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" | ||
exit 1 | ||
fi | ||
# The EXPO_APPLE_APP_SPECIFIC_PASSWORD and EXPO_APPLE_ID are required for Apple builds. | ||
# They're used for appstore submission. | ||
- name: Check for EXPO_APPLE_APP_SPECIFIC_PASSWORD | ||
run: | | ||
if [ -z "${{ secrets.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}" ]; then | ||
echo "You must provide an EXPO_APPLE_APP_SPECIFIC_PASSWORD to deploy to testflight" | ||
fi | ||
- name: Check for EXPO_APPLE_ID | ||
run: | | ||
if [ -z "${{ secrets.EXPO_APPLE_ID }}" ]; then | ||
echo "You must provide an EXPO_APPLE_ID to deploy to testflight" | ||
fi | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Trying to install dependecies from cache | ||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} | ||
name: List the state of node modules | ||
continue-on-error: true | ||
run: npm list | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Setup Expo | ||
uses: expo/expo-github-action@v7 | ||
with: | ||
expo-version: latest | ||
eas-version: latest | ||
token: ${{ secrets.EXPO_TOKEN }} | ||
|
||
# With the flag --auto-submit the build will be submitted to testflight / play store automatically. | ||
# The app will not be released without manual action | ||
- name: Build and Submit | ||
run: eas build --platform all --non-interactive --auto-submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Update | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- production | ||
|
||
jobs: | ||
update: | ||
name: Update | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for EXPO_TOKEN | ||
run: | | ||
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then | ||
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" | ||
exit 1 | ||
fi | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Trying to install dependecies from cache | ||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} | ||
name: List the state of node modules | ||
continue-on-error: true | ||
run: npm list | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Setup Expo | ||
uses: expo/expo-github-action@v7 | ||
with: | ||
expo-version: latest | ||
eas-version: latest | ||
token: ${{ secrets.EXPO_TOKEN }} | ||
|
||
# with the --auto flag set the EAS branch will be named after the GitHub branch | ||
# and the message for the update will match the commit's message. | ||
- name: Publish update | ||
run: eas update --auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
# Setup CI/CD with Github Actions and Expo (eas) | ||
|
||
WIP README | ||
Learn how to setup CI/CD for Expo project with the help of GitHub Actions and EAS | ||
|
||
1. setup project with `expo` | ||
1. add globally `expo-cli` and `eas-cli` | ||
1. install `jest` with `expo install jest-expo jest` | ||
1. add jest commands and config in `app.json` | ||
1. configure eas by running `eas build:configure` | ||
1. remove development client from `eas.json`, we're not using that | ||
1. head to `expo.dev` and create an account along with a project | ||
1. follow the steps to associate the project with the account | ||
1. change the slug in `app.json` to match the one given by `expo.dev` | ||
1. change the owner in `app.json` to match the one given by `expo.dev` | ||
1. run `eas build` once in the terminal to connect to the `eas` service and manage the certificates needed for the build. | ||
1. create GitHub repo and push the project to GitHub | ||
1. Add the workflow | ||
1. Configure the `EXPO_TOKEN` in Github Secrets | ||
1. Head to `expo.dev` **Account Settings > Access Token > Create** | ||
1. Copy & Paste the token on Github Secrets with the name `EXPO_TOKEN` | ||
1. You should be good to go to build the project in CI | ||
Medium Article: [A comprehensive guide on CI/CD for Expo Projects](https://medium.com/@zaniluca/ci-cd-on-github-for-expo-projects-288c517ff14a) |