Last active
August 22, 2024 08:30
-
-
Save mrk-han/3d746054eb721a9973817ec7a21363f1 to your computer and use it in GitHub Desktop.
Simple Guide for a Build and Testing Pipeline with Expo and EAS from Azure Devops CICD (Managed Workflow)
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
# https://aka.ms/yaml | |
trigger: | |
branches: | |
include: | |
- main | |
- releases/* | |
- hotfix/* | |
pr: | |
autoCancel: true | |
drafts: false | |
variables: | |
- group: name-of-variables-group-goes-here | |
stages: | |
- stage: build_and_test | |
displayName: Build and Test | |
pool: | |
vmImage: 'macos-latest' | |
jobs: | |
- job: build | |
displayName: Build | |
steps: | |
- checkout: self | |
clean: true | |
- task: NodeTool@0 | |
inputs: | |
versionSpec: '16.x' | |
displayName: Install Node.js | |
- bash: | | |
set -x | |
npm install -g expo-cli | |
npm install -g eas-cli | |
displayName: Install pipeline dependencies | |
- bash: | | |
set -x | |
expo login -u $(SHARED_EXPO_USERNAME) -p $(SHARED_EXPO_PASSWORD) --non-interactive | |
displayName: Login to expo cli | |
- bash: yarn install --frozen-lockfile | |
displayName: Yarn install | |
- bash: | | |
set -x | |
yarn test:ci | |
displayName: Run Unit Tests | |
- bash: | | |
eas build --platform ios --profile buildForDetoxTesting --local | |
displayName: Build .app for UI Testing on Azure MacOS Agent | |
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) | |
- bash: | | |
eas build --platform ios --non-interactive --no-wait | |
displayName: Run Build on EAS to have .app available on website too | |
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) | |
- bash: | | |
expo publish --non-interactive | |
displayName: Publish app to expo default channel | |
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) | |
- task: PublishTestResults@2 | |
condition: succeededOrFailed() | |
inputs: | |
testRunner: JUnit | |
testResultsFiles: '**/junit.xml' |
@NasTheRobotKing Where do you want to deploy it? To expo go, or app stores?
Hey, nice script there, got a question, how you can add up env variables into it? Since in my project i'm using the .env file to store variables, how you could read from there or is there any other way to access them?
Hello,
It would be for iOS store deployment.
…On Mon, Mar 4, 2024, 9:19 p.m. Mark Han ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
@NasTheRobotKing <https://github.com/NasTheRobotKing> Where do you want
to deploy it? To expo go, or app stores?
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/mrk-han/3d746054eb721a9973817ec7a21363f1#gistcomment-4967951>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARSEQT47QDYIR2CWZHA2OBDYWUTT7BFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTCNRZHAYTSMZQU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you were mentioned.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Hi everyone
I am trying to do almost the same but deploy android and play.store, could someone help me with a very similar example including adroid deployment?
Thanks
The EAS Build keeps returning with the question: √ Do you want to log in to your Apple account?
...
Does anyone know a work-around?
Android build is no issue.
@adrianflda and @jerone did you either of you guys find a solution to your problems?
We got this working:
stages:
- stage: Build
displayName: Build
jobs:
- job: build
displayName: EAS Build for Android and iOS
pool: Default
steps:
- checkout: self
clean: true
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSource: "fromFile"
versionFilePath: ".nvmrc"
- bash: npm ci --no-fund
displayName: "Install NPM dependencies"
- bash: npm install -g eas-cli
displayName: "Install EAS CLI"
# note: `platform all` here means iOS and Android, not Web.
- bash: eas build --platform all --profile preview --no-wait --non-interactive
displayName: "Build on EAS"
env:
EXPO_TOKEN: $(EXPO_TOKEN)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, is there a chance you might have access to a similar script allowing for a Test Container to deploy the iOS .app/.ipa and the Android .apk?