-
Notifications
You must be signed in to change notification settings - Fork 12
71 lines (69 loc) · 2.74 KB
/
staging.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and Publish to Staging
on:
push:
branches:
- develop
concurrency:
group: ref-${{ github.ref }}
cancel-in-progress: true
jobs:
build_staging:
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: '21'
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
- 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 }}
- name: Run license release report
run: ./gradlew licenseReleaseReport --no-configuration-cache --continue
continue-on-error: true
- name: Build
run: "./gradlew :app:assembleStaging"
- 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/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 }}
file: ${{ steps.sign_app.outputs.signedReleaseFile }}
groups: android-testers