Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile - Add expo workflow yaml for allowing devs to trigger manual builds #349

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def remove_expo_yaml_files():
join(".github/workflows", "expo-pr.yml"),
join(".github/workflows", "expo-teststore-build-android.yml"),
join(".github/workflows", "expo-teststore-build-ios.yml"),
join(".github/workflows", "expo-build.yml"),
]
for file_name in file_names:
if exists(file_name):
Expand Down
66 changes: 66 additions & 0 deletions {{cookiecutter.project_slug}}/.github/workflows/expo-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Manually triggered workflow for creating a build
name: Expo Build with given profile

on:
workflow_dispatch:
inputs:
profile:
description: "Build profile"
required: true
default: "development"
type: choice
# Should match the ones in `eas.json`
options:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this goes nicely with my open PR as well that creates dynamic review app based builds.
I think dynamically adding them to the eas.json like this allows us to create unique builds. In this case as you have it, each engineer's build will overwrite the others (although at this moment many of us don't really need builds that often).
I also wonder if this can be avoided by removing the channel arg

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean initially I wrote this because I happened not to have enough permissions in a project to use the eas cli myself so I just used the action to get a build I needed.
This as you said is not something that we would use often, it is just a convenience, mostly to get development builds that we usually need when we deviate from expo go.

- development
- development_simulator
- development_review
- staging
- production
platform:
description: "Platform"
required: true
default: "ios"
type: choice
options:
- android
- ios
- all
clear_cache:
description: "Clear cache"
required: true
default: false
type: "boolean"
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
cache-dependency-path: ./mobile/package-lock.json

- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lakardion - Cookiecutter is trying to render this and failing to 'bake'.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, let's see now


- name: 📦 Install dependencies
working-directory: ./mobile
run: npm install

- name: 🚀 Build app
run: |
cd mobile
CLEAR_CACHE_FLAG=""
if [[ ${{ github.event.inputs.clear_cache }} ]]; then
CLEAR_CACHE_FLAG="--clear-cache"
fi
eas build --profile ${{ github.event.inputs.profile }} --platform ${{ github.event.inputs.platform }} --non-interactive $CLEAR_CACHE_FLAG
Loading