Quick actions enhancement #832
Workflow file for this run
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
name: EAS Local Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "**" ] | |
paths: | |
- 'packages/app/**' | |
- 'apps/expo/**' | |
- 'packages/ui/**' | |
- 'packages/config/**' | |
- 'packages/crosspath/**' | |
pull_request: | |
branches: [ "**" ] | |
paths: | |
- 'packages/app/**' | |
- 'apps/expo/**' | |
- 'packages/ui/**' | |
- 'packages/config/**' | |
- 'packages/crosspath/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: # Define a shared environment variable for android and ios build. | |
MAPBOX_DOWNLOADS_TOKEN: ${{ secrets.MAPBOX_DOWNLOADS_TOKEN }} | |
EXPO_PUBLIC_CLIENT_URL: ${{ secrets.EXPO_PUBLIC_CLIENT_URL }} | |
EXPO_PUBLIC_API_URL: ${{ secrets.EXPO_PUBLIC_API_URL }} | |
EXPO_PUBLIC_MAPBOX_ACCESS_TOKEN: ${{ secrets.EXPO_PUBLIC_MAPBOX_ACCESS_TOKEN }} | |
jobs: | |
build-android: | |
runs-on: ubuntu-latest | |
# will be used in find_or_create_comment | |
# and update_native_build_preview action | |
env: | |
build-name: Android APK | |
comment-unique-magic-prefix: '<!-- android_build_status -->' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Find or create comment for build status | |
if: github.event_name == 'pull_request' | |
uses: ./.github/actions/find-or-create-comment | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Standard Environment | |
uses: ./.github/actions/setup-standard-environment | |
with: | |
expo-token: ${{ secrets.EXPO_TOKEN }} | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Run Local Build for Android | |
id: build | |
working-directory: ./apps/expo | |
run: | | |
eas build --profile preview --platform android --local --non-interactive | |
env: | |
EXPO_PUBLIC_ANDROID_CLIENT_ID: ${{ secrets.EXPO_PUBLIC_ANDROID_CLIENT_ID }} | |
- name: Upload APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: android-apk | |
path: /home/runner/work/PackRat/PackRat/apps/expo/build-*.apk | |
- name: Update build status | |
if: always() && github.event_name == 'pull_request' | |
uses: ./.github/actions/update-native-preview-build-status | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
build-outcome: ${{ steps.build.outcome }} | |
build-ios: | |
runs-on: macos-latest | |
env: | |
build-name: iOS IPA | |
comment-unique-magic-prefix: '<!-- ios_build_status -->' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Find or create comment for build status | |
if: github.event_name == 'pull_request' | |
uses: ./.github/actions/find-or-create-comment | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Standard Environment | |
uses: ./.github/actions/setup-standard-environment | |
with: | |
expo-token: ${{ secrets.EXPO_TOKEN }} | |
# - name: Setup Xcode | |
# uses: maxim-lobanov/setup-xcode@v1 | |
# with: | |
# xcode-version: latest-stable | |
- name: Run Local Build for iOS | |
id: build | |
working-directory: ./apps/expo | |
run: | | |
export MAPBOX_DOWNLOADS_TOKEN=${{ secrets.MAPBOX_DOWNLOADS_TOKEN }} | |
eas build --profile preview --platform ios --local --non-interactive | |
env: | |
EXPO_PUBLIC_IOS_CLIENT_ID: ${{ secrets.EXPO_PUBLIC_IOS_CLIENT_ID }} | |
- name: Upload IPA | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ios-ipa | |
path: /Users/runner/work/PackRat/PackRat/apps/expo/build-*.ipa | |
- name: Update build status | |
if: always() && github.event_name == 'pull_request' | |
uses: ./.github/actions/update-native-preview-build-status | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
build-outcome: ${{ steps.build.outcome }} | |