-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (76 loc) · 3.04 KB
/
android.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# OLD, not longer needed?. We use buildrelease.yml and deploy.yml
name: Build & Publish Release APK
on:
workflow_dispatch: # run manually
push:
tags:
- 'Release*'
jobs:
build:
runs-on: ubuntu-latest
steps:
# - name: get the date
# id: date
# run: |
# NOW=$(date +"%Y%m%d")
# echo "now=${NOW}" >> $GITHUB_OUTPUT
- name: Setup Java JDK
uses:
actions/[email protected]
with:
java-version: 11
distribution: 'adopt'
- name: Checkout the code
uses: actions/[email protected]
- name: Make pipeline script files executable where needed
run: chmod +x ./gradlew ./build.gradle.adapt.for.github.workflow.sh ./change.R.package.sh
- name: Adapt build.gradle and google-services.json by means of script
env:
GSM_API_KEY: ${{ secrets.GSM_API_KEY }}
run: ./build.gradle.adapt.for.github.workflow.sh ${GSM_API_KEY}
- name: adapt sources and res files to build different brand
run: ./change.R.package.sh Squore
- name: Build unsigned release .apk files
run: ./gradlew build
- name: Sign .apk files
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
run: |
echo "${KEYSTORE_BASE64}" | base64 -d > apksign.keystore
set -x
androidhome="${ANDROID_HOME:-${ANDROID_SDK}}"
for unsignedFn in build/outputs/apk/*/release/*.apk; do
signedFn=${unsignedFn/release-unsigned/release-signed}
${androidhome}/build-tools/$(ls ${androidhome}/build-tools/ | tail -1)/apksigner sign --ks apksign.keystore --ks-pass pass:"${KEYSTORE_PASSWORD}" --out "${signedFn}" "${unsignedFn}"
done
rm -v apksign.keystore
- name: Extract the version from build.gradle
id: extract_version
run: |
VERSION=$(grep 'def\s*versionCodeXXX' build.gradle | cut -d '=' -f 2 | tr -d ' ')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Upload artifact for phone
uses: actions/[email protected]
with:
name: Squore.phone.${{ steps.extract_version.outputs.version }}.apk
path: build/outputs/apk/phoneTabletPost23/release/Squore-phoneTabletPost23-release-signed.apk
- name: Upload artifact for wearOs
uses: actions/[email protected]
with:
name: Squore.wearOs.${{ steps.extract_version.outputs.version }}.apk
path: build/outputs/apk/wearOs/release/Squore-wearOs-release-signed.apk
- name: Create upload .apk to /releases
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
tag: "${{ steps.extract_version.outputs.version }}"
#prerelease: "${{ steps.extract_version.outputs.beta }}"
#draft: "${{ inputs.draft }}"
artifacts: ./build/outputs/apk/*/release/*-*-release-signed.apk
generateReleaseNotes: false
#- name: Releasing using Hub
# uses: sangatdesai/release-apk@main
# env:
# GITHUB_TOKEN: ${{ secrets.TOKEN }}
# APP_FOLDER: app