# This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. name: PR check on: push: branches: ["main"] pull_request: branches: ["main"] jobs: pr-id: name: Get PR id runs-on: macos-14 timeout-minutes: 10 outputs: pull-request-id: ${{ steps.pull-request-id-step.outputs.id }} steps: - uses: 8BitJonny/gh-get-current-pr@2.2.0 id: PR - id: pull-request-id-step run: echo "id=${{ steps.PR.outputs.number }}" >> "$GITHUB_OUTPUT" analyze-and-test: name: Analyze & test needs: [pr-id] uses: ./.github/workflows/analyze_and_test.yml secrets: inherit with: is-fork: ${{ needs.pr-id.outputs.pull-request-id== 'null' || github.event.pull_request.head.repo.full_name == github.repository }} platform-changes: name: Checks for platform changes runs-on: ubuntu-latest outputs: android-changed: ${{ steps.platform-changes.outputs.android-changed }} ios-changed: ${{ steps.platform-changes.outputs.ios-changed }} steps: - uses: actions/checkout@v3 with: submodules: recursive - id: platform-changes uses: dorny/paths-filter@v2 with: filters: | android-changed: - 'android/**' - 'pubspec.yaml' ios-changed: - 'ios/**' - 'pubspec.yaml' build-android: name: Build Android needs: platform-changes if: needs.platform-changes.outputs.android-changed == 'true' uses: ./.github/workflows/build_apk.yml secrets: inherit with: binary-type: apk flavor: prod stage-backend: false version: "1.0.0" build-ios: name: Build iOS needs: platform-changes if: needs.platform-changes.outputs.ios-changed == 'true' uses: ./.github/workflows/build_ipa.yml secrets: inherit with: stage-backend: false version: "1.0.0" cleanup: name: Cleanup if: ${{ always() }} needs: [build-android, build-ios] runs-on: ubuntu-latest steps: - name: Delete release artifacts uses: geekyeggo/delete-artifact@v2 with: failOnError: false name: | m3_lightmeter_apk m3_lightmeter_appbundle m3_lightmeter_ipa