Skip to content

Bump version

Bump version #125

name: Build and Publish to Play Store
on:
push:
branches:
- release/**
- hotfix/**
concurrency:
group: ref-${{ github.ref }}
cancel-in-progress: true
jobs:
build_release:
runs-on: ubuntu-latest-8-vcpu
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@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/actions/setup-gradle@v4
with:
# Only write to the cache for builds on the 'develop' branch
cache-read-only: false
gradle-home-cache-cleanup: true
- run: echo VERSION_CODE=$(date +%s) >> $GITHUB_ENV
- uses: chkfung/[email protected]
with:
gradlePath: app/app/build.gradle.kts
versionCode: ${{ env.VERSION_CODE }}
- name: Prebuild
run: ./scripts/ci-release-prebuild.sh
env:
LOKALISE_ID: ${{ secrets.LOKALISE_ID }}
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
- name: Run license release report
run: ./gradlew licenseReleaseReport --no-configuration-cache --continue
continue-on-error: true
- name: Build
run: "./gradlew :app:assembleRelease"
- 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 APK
id: sign_app
with:
releaseDirectory: app/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Deploy to Play Store Internal-track
uses: r0adkll/[email protected]
with:
releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }}
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
packageName: com.hedvig.app
track: internal
mappingFile: app/app/build/outputs/mapping/release/mapping.txt
status: completed