Skip to content

Matcher: Status API #339

Matcher: Status API

Matcher: Status API #339

Workflow file for this run

name: "Front (Mobile)"
on:
pull_request:
branches: [main]
push:
branches: [main]
release:
types: [published]
defaults:
run:
working-directory: ./front/apps/mobile
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
front: ${{ steps.filter.outputs.front }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
front:
- 'front/apps/mobile/**'
- 'front/package.json'
- 'front/translations/**'
- 'front/packages/**'
- '.github/workflows/front-mobile.yml'
- '.github/actions/cache-front/**'
# TODO Does not work, reports errors about unknown props
# Typecheck:
# needs: changes
# if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }}
# runs-on: ubuntu-latest
# steps:
# - name: Check out the repo
# uses: actions/checkout@v3
# - name: Restore Dependencies
# uses: ./.github/actions/cache-front
# - name: Install Dependencies
# run: yarn workspaces focus mobile
# - name: Run tsc
# run: yarn workspace mobile tsc
Biome:
needs: changes
# Note: We don't need Biome to be run, however, since Build needs it
# We have no choice but to run it anyway :(
if: ${{ github.event_name == 'release' || (needs.changes.outputs.front == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Restore Dependencies
uses: ./.github/actions/cache-front
- name: Install Dependencies
run: yarn workspaces focus -A
- name: Run Linter
run: yarn run -T biome ci . ../../packages
Build:
needs: [Biome]
permissions:
contents: write
if: ${{ github.event_name == 'release' || (needs.changes.outputs.front == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Get Tag
shell: bash
if: ${{ github.event_name == 'release' }}
run: echo "EXPO_PUBLIC_BUILD_COMMIT=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Get Commit
shell: bash
if: ${{ github.event_name != 'release' }}
run: echo "EXPO_PUBLIC_BUILD_COMMIT=$(git rev-parse --short ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }})" >> $GITHUB_ENV
- run: echo "APK_NAME=${{ github.event_name == 'pull_request' && 'meelo-preview.apk' || 'meelo.apk' }}" >> $GITHUB_ENV
- name: Restore Dependencies
uses: ./.github/actions/cache-front
- name: Install Dependencies
run: yarn workspaces focus -A
# https://github.com/thomasread99/expo-workflows/blob/cd3a0efc7ff3cfa83dec9b03f7bb078d78f46b88/android/android-apk-build.yml#L19C7-L23C34
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Build
run: |
eas build --platform android --profile ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} --local --non-interactive && mv *.apk ${{ env.APK_NAME }}
- name: Upload APK
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.APK_NAME }}
path: front/apps/mobile/${{ env.APK_NAME }}
- name: Add APK to release
uses: softprops/action-gh-release@v2
if: ${{ github.event_name == 'release' }}
with:
files: |
./front/apps/mobile/${{ env.APK_NAME }}