Skip to content

Instantly share code, notes, and snippets.

@frankbaele
Last active December 6, 2023 13:51
Show Gist options
  • Save frankbaele/3e4342c2a354ebc9d975c53db2af1ea6 to your computer and use it in GitHub Desktop.
Save frankbaele/3e4342c2a354ebc9d975c53db2af1ea6 to your computer and use it in GitHub Desktop.
Eas, maestro and github actions setup
{
"build": {
"development": {
"distribution": "internal",
"channel": "develop",
"ios": {
"simulator": true
},
"autoIncrement": true
},
}
}
name: "Development build"
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [ ios, android ]
include:
- platform: ios
- platform: android
steps:
- name: Install jq
uses: dcarbone/install-jq-action@v2.1.0
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: npm
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: npm ci
- name: 🚀 Build app
run: eas build --non-interactive --platform=${{ matrix.platform }} --profile=development
- name: 🚀 Get artifact url
id: get_artifact_url
run: |
BUILD_DETAILS=$(eas build:list --non-interactive --platform ${{matrix.platform}} --limit 1 --status finished --json)
APP_BUILD_VERSION=$(echo "$BUILD_DETAILS" | jq -r '.[0].appBuildVersion')
APPLICATION_ARCHIVE_URL=$(echo "$BUILD_DETAILS" | jq -r '.[0].artifacts.applicationArchiveUrl')
echo "build_version=$APP_BUILD_VERSION" >> $GITHUB_OUTPUT
echo "artifact_url=$APPLICATION_ARCHIVE_URL" >> $GITHUB_OUTPUT
- name: Set file extension for artifact
id: file_extension
run: echo "file_extension=${{ matrix.platform == 'android' && 'apk' || 'zip' }}" >> $GITHUB_OUTPUT
- name: ⬇️ Download Android Build Artifact
if: steps.get_artifact_url.outputs.artifact_url != '' && matrix.platform == 'android'
run: |
curl -L -o build_artifact.apk "${{ steps.get_artifact_url.outputs.artifact_url }}"
- name: ⬇️ Download IOS Build Artifact
if: steps.get_artifact_url.outputs.artifact_url != '' && matrix.platform == 'ios'
run: |
curl -L -o build_artifact.tar.gz "${{ steps.get_artifact_url.outputs.artifact_url }}"
tar xzf build_artifact.tar.gz && zip build_artifact.zip $(tar tf build_artifact.tar.gz)
- uses: mobile-dev-inc/action-maestro-cloud@v1
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: build_artifact.${{ steps.file_extension.outputs.file_extension }}
- name: check sentry for errors
run: |
API_ENDPOINT="https://sentry.io/api/0/projects/bildpunkt-b87230039/visite/issues/?query=dist%3A${{steps.get_artifact_url.outputs.build_version}}+is%3Aunresolved+os.name%3A${{steps.set_os_name.outputs.os_name}}&statsPeriod=24h"
JSON_DATA=$(curl -H "Authorization: Bearer ${{ secrets.SENTRY_TOKEN }}" "${API_ENDPOINT}")
ITEM_COUNT=$(echo "${JSON_DATA}" | jq length)
if [ "${ITEM_COUNT}" -gt 1 ]; then
echo "Error: More than one issue found. Count: ${ITEM_COUNT}"
exit 1
else
echo "Count is acceptable. Count: ${ITEM_COUNT}"
fi
# flow.yaml
appId: be.visitoostende.visite
---
- launchApp
- runFlow:
when:
visible:
id: "register_email"
commands:
- tapOn:
id: "register_button"
- tapOn:
id: "register_email"
- inputText: "test@test.com"
- hideKeyboard
- tapOn:
id: "register_button"
- tapOn: "Culture"
- tapOn:
id: "walk_677"
- tapOn:
id: "start_walk_704"
- repeat:
while:
notVisible:
id: "location_23073"
commands:
- tapOn: ›
- tapOn:
id: "location_23073"
- tapOn:
id: "toggle_playback"
- tapOn:
id: "toggle_playback"
- tapOn:
id: "video_0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment