Publish to app testing #1861
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: Build and Publish to Staging | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - chore/fix-app-icon | |
| workflow_dispatch: | |
| concurrency: | |
| group: ref-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_staging: | |
| runs-on: ubuntu-latest-8-vcpu | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup CI | |
| uses: ./.github/actions/common-setup | |
| with: | |
| gradle-cache-read-only: 'false' | |
| datadog-api-key: ${{ secrets.DATADOG_API_KEY }} | |
| lokalise-id: ${{ secrets.LOKALISE_ID }} | |
| lokalise-token: ${{ secrets.LOKALISE_TOKEN }} | |
| - run: echo VERSION_CODE=$(expr 4700 + ${{ github.run_number }} + ${{ github.run_attempt }} - 1) >> $GITHUB_ENV | |
| - uses: chkfung/[email protected] | |
| with: | |
| gradlePath: app/app/build.gradle.kts | |
| versionCode: ${{ env.VERSION_CODE }} | |
| - name: Run license release report | |
| run: ./gradlew licenseReleaseReport --no-configuration-cache --continue | |
| continue-on-error: true | |
| - name: Build | |
| run: "./gradlew :app:bundleStaging" | |
| - name: Setup build tool version variable | |
| shell: bash | |
| run: | | |
| BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | |
| echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV | |
| echo Last build tool version is: $BUILD_TOOL_VERSION | |
| - uses: r0adkll/sign-android-release@v1 | |
| name: Sign app AAB | |
| id: sign_app | |
| with: | |
| releaseDirectory: app/app/build/outputs/bundle/staging | |
| signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
| alias: ${{ secrets.ALIAS }} | |
| keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
| keyPassword: ${{ secrets.KEY_PASSWORD }} | |
| env: | |
| BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
| - uses: wzieba/[email protected] | |
| with: | |
| serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIALS_FILE_CONTENT }} | |
| appId: ${{ secrets.FIREBASE_STAGING_APP_ID_PACKAGE_COM_HEDVIG_APP }} | |
| file: ${{ steps.sign_app.outputs.signedReleaseFile }} | |
| groups: android-testers | |
| - name: Upload mapping files to datadog | |
| run: "./gradlew uploadMappingStaging --no-configuration-cache" |