-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreusable-android-release-apk.yaml
More file actions
88 lines (76 loc) · 2.59 KB
/
reusable-android-release-apk.yaml
File metadata and controls
88 lines (76 loc) · 2.59 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Reusable Android SDK publish to Sona
on:
workflow_call:
inputs:
appId:
required: true
type: string
description: 'App ID for committing and pushing'
secrets:
appSecret:
required: true
googleServicesFileAsBase64:
required: true
googlePlaySigningKeyFileAsBase64:
required: true
releaseStorePassword:
required: true
releaseKeyAlias:
required: true
releaseKeyPassword:
required: true
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ inputs.appId }}
private-key: ${{ secrets.appSecret }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Get current version from source
env:
FILE_PATH: 'version.properties'
id: version_source
run: |
current_version=$(awk -F"=" '/VERSION_NAME/ {print $2}' "$FILE_PATH")
echo "version=$current_version" >> $GITHUB_OUTPUT
- name: Decode and create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.googleServicesFileAsBase64 }}
run: |
mkdir -p app/src/prod/release
echo "$GOOGLE_SERVICES_JSON" | base64 -d > app/src/prod/release/google-services.json
- name: Debug google-services
run: echo "${{ secrets.googleServicesFileAsBase64 }}" | base64 -d
- name: Decode Keystore
run: |
echo "$KEYSTORE_AS_BASE64" | base64 --decode > app/keystore.jks
env:
KEYSTORE_AS_BASE64: ${{ secrets.googlePlaySigningKeyFileAsBase64 }}
- name: Set up JDK 20
uses: actions/setup-java@v4
with:
java-version: '20'
distribution: 'zulu'
- name: Build Release APK
run: ./gradlew assembleProdRelease
env:
SIGNING_STORE_FILE: ${{ github.workspace }}/app/keystore.jks
SIGNING_STORE_PASSWORD: ${{ secrets.releaseStorePassword }}
SIGNING_KEY_ALIAS: ${{ secrets.releaseKeyAlias }}
SIGNING_KEY_PASSWORD: ${{ secrets.releaseKeyPassword }}
- name: Prepare release directory
run: |
mkdir -p release
cp app/build/outputs/apk/prod/release/app-prod-release.apk release/
- name: Create release
env:
TAG: ${{ steps.version_source.outputs.version }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
gh release create "v$TAG" ./release/app-prod-release.apk \
--title=$TAG \
--generate-notes