-
Notifications
You must be signed in to change notification settings - Fork 9
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
36f03bd
feat(expo) add expo build workflow for profiles
lakardion dd1b9c5
Merge branch 'main' into feature/add-expo-build-workflow
whusterj 7147e08
fix cookiecutter rendering
lakardion 20cae8f
Merge branch 'main' into feature/add-expo-build-workflow
whusterj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
66 changes: 66 additions & 0 deletions
66
{{cookiecutter.project_slug}}/.github/workflows/expo-build.yml
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,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: | ||
- 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 }}" }} | ||
|
||
- 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.