name: Build

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: macos-13
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Select Xcode version
        run: sudo xcode-select -s '/Applications/Xcode_15.0.app/Contents/Developer'
      - name: Run fastlane
        env: 
          EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
        run: bundle install && bundle exec fastlane build
