DEV-168: add reports to release #15
This file contains hidden or 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: Flutter Branch Workflow | ||
|
Check failure on line 1 in .github/workflows/flutter-release.yml
|
||
| env: | ||
| ENVIRONMENT_FILE: .env | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| ios-build-arguments: | ||
| description: "any extra arguments such as using sksl or passing a variable using --dart-define etc. for iOS build" | ||
| type: string | ||
| required: false | ||
| android-build-arguments: | ||
| description: "any extra arguments such as using sksl or passing a variable using --dart-define etc. for Android build" | ||
| type: string | ||
| required: false | ||
| publish-to-testflight: | ||
| description: "Should publish to Testflight? (Note: this parameter is not used and is only for backward compatibility)" | ||
| type: boolean | ||
| default: true | ||
| working-directory: | ||
| description: "the directory to run each job of the workflow in" | ||
| type: string | ||
| default: "." | ||
| static-analysis: | ||
| description: "Run static analysis with Sonarqube" | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
| submit-ios-build-for-review: | ||
| description: 'Submit TestFlight Build for Review' | ||
| type: boolean | ||
| default: false | ||
| artifact-name-suffix: | ||
| description: "the suffix to add to the artifact name (Not used but kept for backward compatibility)" | ||
| type: string | ||
| default: "" | ||
| git-lfs: | ||
| description: "Checkout the project with git lfs" | ||
| type: boolean | ||
| default: false | ||
| obfuscate: | ||
| description: "Should obfuscate the dart code?" | ||
| type: boolean | ||
| default: false | ||
| dependency-reports: | ||
| description: "Generate dependency reports" | ||
| type: boolean | ||
| default: true | ||
| workflow_dispatch: | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| generate-build-number: | ||
| # runs-on: [self-hosted] | ||
| runs-on: default-k8s-runner | ||
| outputs: | ||
| build-number: ${{ steps.build-number-generator.outputs.build-number }} | ||
| steps: | ||
| - name: Generate Build Number | ||
| id: build-number-generator | ||
| run: | | ||
| build_number=$(date +%s) | ||
| echo "build-number=$build_number" >> $GITHUB_OUTPUT | ||
| echo "Build Number: $build_number" | ||
| ios-name-suffix-generation: | ||
| # runs-on: [self-hosted] | ||
| runs-on: default-k8s-runner | ||
| outputs: | ||
| name-suffix: ${{ steps.name-suffix-generator.outputs.name-suffix }} | ||
| steps: | ||
| - id: name-suffix-generator | ||
| uses: QuickBirdEng/actions/flutter-name-suffix-generator@main | ||
| with: | ||
| platform: ios | ||
| build-arguments: ${{ inputs.android-build-arguments }} | ||
| android-name-suffix-generation: | ||
| # runs-on: [self-hosted] | ||
| runs-on: default-k8s-runner | ||
| if: ${{ github.ref_type == 'tag' }} | ||
| outputs: | ||
| name-suffix: ${{ steps.name-suffix-generator.outputs.name-suffix }} | ||
| steps: | ||
| - id: name-suffix-generator | ||
| uses: QuickBirdEng/actions/flutter-name-suffix-generator@main | ||
| with: | ||
| platform: android | ||
| build-arguments: ${{ inputs.android-build-arguments }} | ||
| lint: | ||
| # runs-on: [self-hosted] | ||
| runs-on: default-k8s-runner | ||
| defaults: | ||
| run: | ||
| working-directory: ${{ inputs.working-directory }} | ||
| steps: | ||
| - uses: QuickBirdEng/actions/checkout-ssh@main | ||
| with: | ||
| ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }} | ||
| git-lfs: ${{ inputs.git-lfs }} | ||
| - uses: QuickBirdEng/actions/setup-flutter@main | ||
| with: | ||
| use-cache: false | ||
| clean: true | ||
| working-directory: ${{ inputs.working-directory }} | ||
| - run: flutter analyze | ||
| test: | ||
| # runs-on: [self-hosted, Linux] | ||
| runs-on: default-k8s-runner | ||
| defaults: | ||
| run: | ||
| working-directory: ${{ inputs.working-directory }} | ||
| steps: | ||
| - uses: QuickBirdEng/actions/checkout-ssh@main | ||
| with: | ||
| ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }} | ||
| git-lfs: ${{ inputs.git-lfs }} | ||
| - uses: QuickBirdEng/actions/setup-flutter@main | ||
| with: | ||
| use-cache: false | ||
| clean: true | ||
| working-directory: ${{ inputs.working-directory }} | ||
| - run: flutter test --dart-define STAGE=mock | ||
| static-analysis: | ||
| # runs-on: [self-hosted, Linux] | ||
| runs-on: default-k8s-runner | ||
| if: ${{ inputs.static-analysis }} | ||
| defaults: | ||
| run: | ||
| working-directory: ${{ inputs.working-directory }} | ||
| steps: | ||
| - uses: QuickBirdEng/actions/checkout-ssh@main | ||
| with: | ||
| ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }} | ||
| git-lfs: ${{ inputs.git-lfs }} | ||
| - uses: QuickBirdEng/actions/setup-flutter@main | ||
| with: | ||
| use-cache: false | ||
| clean: true | ||
| working-directory: ${{ inputs.working-directory }} | ||
| - uses: QuickBirdEng/actions/sonarqube-flutter@main | ||
| with: | ||
| sonar-token: ${{ secrets.SONAR_TOKEN_FLUTTER }} | ||
| sonar-host-url: ${{ secrets.SONAR_HOST_URL }} | ||
| android-publish: | ||
| runs-on: [self-hosted] | ||
| needs: [generate-build-number, lint, test] | ||
| steps: | ||
| - uses: QuickBirdEng/actions/checkout-ssh@main | ||
| with: | ||
| ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }} | ||
| git-lfs: ${{ inputs.git-lfs }} | ||
| - uses: QuickBirdEng/actions/publish-android@main | ||
| id: publish-android | ||
| with: | ||
| use-cache: false | ||
| clean: true | ||
| build-number: ${{ needs.generate-build-number.outputs.build-number }} | ||
| build-arguments: ${{ inputs.android-build-arguments }} | ||
| working-directory: ${{ inputs.working-directory }} | ||
| key-store-file-content: ${{ secrets.ANDROID_KEYSTORE_FILE_CONTENT }} | ||
| key-store-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||
| signing-key-alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} | ||
| signing-key-password: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | ||
| qbs-maven-username: ${{ secrets.QBS_DEV_MAVEN_USERNAME }} | ||
| qbs-maven-password: ${{ secrets.QBS_DEV_MAVEN_PASSWORD }} | ||
| upload-key: ${{ secrets.UPLOAD_KEY }} | ||
| obfuscate: ${{ inputs.obfuscate }} | ||
| - uses: QuickBirdEng/actions/upload-debug-symbols-to-sentry@main | ||
| env: | ||
| SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | ||
| if: ${{ env.SENTRY_PROJECT != '' }} | ||
| with: | ||
| url: ${{ secrets.SENTRY_URL }} | ||
| organization: ${{ secrets.SENTRY_ORG }} | ||
| project: ${{ secrets.SENTRY_PROJECT }} | ||
| auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
| dart-symbols-file-path: ${{ steps.publish-android.outputs.artifact-dart-symbols-file-path }} | ||
| proguard-mapping-file-path: ${{ inputs.working-directory }}/build/app/outputs/mapping/release/mapping.txt | ||
| continue-on-error: true | ||
| ios-publish: | ||
| runs-on: [self-hosted, macOS] | ||
| needs: [generate-build-number, lint, test, ios-name-suffix-generation] | ||
| steps: | ||
| - uses: QuickBirdEng/actions/checkout-ssh@main | ||
| with: | ||
| ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }} | ||
| git-lfs: ${{ inputs.git-lfs }} | ||
| - uses: QuickBirdEng/actions/publish-ios@main | ||
| id: publish-ios | ||
| with: | ||
| apple-auth-key-id: ${{ secrets.APPLE_AUTH_KEY_ID }} | ||
| apple-auth-key-issuer-id: ${{ secrets.APPLE_AUTH_KEY_ISSUER_ID }} | ||
| apple-auth-key-content: ${{ secrets.APPLE_AUTH_KEY_CONTENT }} | ||
| apple-auth-key-encoding: "base64" | ||
| match-password: ${{ secrets.MATCH_PASSWORD }} | ||
| match-repository: ${{ secrets.MATCH_REPO }} | ||
| match-apple-id: ${{ secrets.APPLE_ID }} | ||
| match-apple-team-id: ${{ secrets.APPLE_TEAM_ID }} | ||
| match-keychain-password: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }} | ||
| build-number: ${{ needs.generate-build-number.outputs.build-number }} | ||
| slack-slug: ${{ secrets.SLACK_SLUG }} | ||
| working-directory: ${{ inputs.working-directory }} | ||
| release-notes: ${{ inputs.ios-build-arguments }} | ||
| submit-for-review: ${{ inputs.submit-ios-build-for-review }} | ||
| build-arguments: ${{ inputs.ios-build-arguments }} | ||
| obfuscate: ${{ inputs.obfuscate }} | ||
| - uses: QuickBirdEng/actions/upload-debug-symbols-to-sentry@main | ||
| env: | ||
| SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | ||
| if: ${{ env.SENTRY_PROJECT != '' }} | ||
| with: | ||
| url: ${{ secrets.SENTRY_URL }} | ||
| organization: ${{ secrets.SENTRY_ORG }} | ||
| project: ${{ secrets.SENTRY_PROJECT }} | ||
| auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
| dart-symbols-file-path: ${{ steps.publish-ios.outputs.artifact-dsyms-path }} | ||
| dsyms-path: ${{ steps.publish-ios.outputs.artifact-dart-symbols-file-path }} | ||
| continue-on-error: true | ||
| - name: Compress & Upload Artifact to QB Spaces | ||
| uses: QuickBirdEng/actions/compress-and-upload-artifact-qb@main | ||
| with: | ||
| access-key: ${{ secrets.DO_ACCESS_KEY }} | ||
| secret-key: ${{ secrets.DO_SECRET_KEY }} | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| name-suffix: ${{ needs.ios-name-suffix-generation.outputs.name-suffix }} | ||
| artifact-path: ${{ steps.publish-ios.outputs.artifact-path }} | ||
| android-bundle: | ||
| runs-on: [self-hosted] | ||
| needs: [generate-build-number, lint, test, android-name-suffix-generation] | ||
| if: ${{ github.ref_type == 'tag' }} | ||
| steps: | ||
| - uses: QuickBirdEng/actions/checkout-ssh@main | ||
| with: | ||
| ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }} | ||
| git-lfs: ${{ inputs.git-lfs }} | ||
| - uses: QuickBirdEng/actions/setup-android@main | ||
| with: | ||
| key-store-file-content: ${{ secrets.ANDROID_KEYSTORE_FILE_CONTENT }} | ||
| key-store-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||
| signing-key-alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} | ||
| signing-key-password: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | ||
| qbs-maven-username: ${{ secrets.QBS_DEV_MAVEN_USERNAME }} | ||
| qbs-maven-password: ${{ secrets.QBS_DEV_MAVEN_PASSWORD }} | ||
| - uses: QuickBirdEng/actions/flutter-build@main | ||
| id: flutter-build | ||
| with: | ||
| use-cache: false | ||
| clean: true | ||
| build-type: appbundle | ||
| build-number: ${{ needs.generate-build-number.outputs.build-number }} | ||
| build-arguments: ${{ inputs.android-build-arguments }} | ||
| working-directory: ${{ inputs.working-directory }} | ||
| obfuscate: ${{ inputs.obfuscate }} | ||
| - uses: QuickBirdEng/actions/upload-debug-symbols-to-sentry@main | ||
| env: | ||
| SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | ||
| if: ${{ env.SENTRY_PROJECT != '' }} | ||
| with: | ||
| url: ${{ secrets.SENTRY_URL }} | ||
| organization: ${{ secrets.SENTRY_ORG }} | ||
| project: ${{ secrets.SENTRY_PROJECT }} | ||
| auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
| dart-symbols-file-path: ${{ steps.flutter-build.outputs.artifact-dart-symbols-file-path }} | ||
| proguard-mapping-file-path: ${{ inputs.working-directory }}/build/app/outputs/mapping/release/mapping.txt | ||
| continue-on-error: true | ||
| - name: Compress & Upload Artifact to QB Spaces | ||
| uses: QuickBirdEng/actions/compress-and-upload-artifact-qb@main | ||
| with: | ||
| access-key: ${{ secrets.DO_ACCESS_KEY }} | ||
| secret-key: ${{ secrets.DO_SECRET_KEY }} | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| name-suffix: ${{ needs.android-name-suffix-generation.outputs.name-suffix }} | ||
| artifact-path: ${{ steps.flutter-build.outputs.artifact-path }} | ||
| dependency-reports: | ||
| if: ${{ inputs.dependency-reports }} | ||
| uses: QuickBirdEng/workflows/.github/workflows/vulnerability-and-outdated-packages-report.yml@main | ||
| with: | ||
| flutter-working-directory: ${{ inputs.working-directory }} | ||
| flutter-report: true | ||
| secrets: inherit | ||
| soup-reports: | ||
| if: ${{ github.ref_type == 'tag' }} | ||
| uses: QuickBirdEng/workflows/.github/workflows/soups-generate-reports.yml@main | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| secrets: inherit | ||