Merge pull request #1837 from HedvigInsurance/renovate/androidx.other… #680
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: Build and Publish to Staging | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build_staging: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: Add GitHub Packages auth | |
run: ./scripts/ci-github-packages-properties.sh | |
env: | |
HEDVIG_GITHUB_PACKAGES_USER: ${{ secrets.HEDVIG_GITHUB_PACKAGES_USER }} | |
HEDVIG_GITHUB_PACKAGES_TOKEN: ${{ secrets.HEDVIG_GITHUB_PACKAGES_TOKEN }} | |
- name: Setup JDK 17 | |
uses: actions/[email protected] | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
# Only write to the cache for builds on the 'develop' branch | |
cache-read-only: ${{ github.ref != 'refs/heads/develop' }} | |
gradle-home-cache-cleanup: true | |
- 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: Prebuild | |
run: ./scripts/ci-staging-prebuild.sh | |
env: | |
LOKALISE_ID: ${{ secrets.LOKALISE_ID }} | |
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }} | |
ADYEN_CLIENT_KEY: ${{ secrets.ADYEN_TEST_CLIENT_KEY }} | |
- name: Run license release report | |
run: ./gradlew licenseReleaseReport --no-configuration-cache --continue | |
continue-on-error: true | |
- name: Build | |
run: "./gradlew :app:assembleStaging" | |
- uses: r0adkll/sign-android-release@v1 | |
name: Sign app APK | |
id: sign_app | |
with: | |
releaseDirectory: app/app/build/outputs/apk/staging | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "30.0.2" | |
- uses: wzieba/[email protected] | |
with: | |
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIALS_FILE_CONTENT }} | |
appId: ${{ secrets.FIREBASE_STAGING_APP_ID }} | |
file: ${{ steps.sign_app.outputs.signedReleaseFile }} | |
groups: android-testers |