-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (93 loc) · 3.67 KB
/
ci-release.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
92
93
name: ci-release
on:
release:
types:
- created
- prereleased
jobs:
build:
runs-on: ubuntu-20.04
env:
APP_VERSION: ${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v2
with:
repository: eu-digital-green-certificates/dgca-app-core-android
ref: main
path: dgca-app-core-android
- uses: actions/checkout@v2
with:
repository: eu-digital-green-certificates/dgc-certlogic-android
ref: main
path: dgc-certlogic-android
- uses: actions/checkout@v2
with:
path: dgca-wallet-app-android
- uses: actions/setup-java@v1
with:
java-version: '11'
distribution: adopt
- uses: android-actions/setup-android@v2
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- name: build
working-directory: ./dgca-wallet-app-android
run: |-
./gradlew --no-daemon build
- name: sign-tst
working-directory: ./dgca-wallet-app-android
run: |-
echo "${KEY_STORE_BASE64}" | base64 --decode > ./key.jks
ZIPALIGN=${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/zipalign
APKSIGNER=${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/apksigner
${ZIPALIGN} -c -v 4 ./app/build/outputs/apk/tst/release/app-tst-release-unsigned.apk
${APKSIGNER} sign \
--ks ./key.jks \
--ks-pass pass:${KEY_STORE_PASSWORD} \
--ks-key-alias ${KEY_ALIAS} \
--key-pass pass:${KEY_PASSWORD} \
--out ./app/build/outputs/apk/tst/release/app-tst-release-signed.apk \
./app/build/outputs/apk/tst/release/app-tst-release-unsigned.apk
${APKSIGNER} verify ./app/build/outputs/apk/tst/release/app-tst-release-signed.apk
env:
BUILD_TOOLS_VERSION: 29.0.3
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_BASE64: ${{ secrets.KEY_STORE_BASE64 }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- name: sign-acc
working-directory: ./dgca-wallet-app-android
run: |-
echo "${KEY_STORE_BASE64}" | base64 --decode > ./key.jks
ZIPALIGN=${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/zipalign
APKSIGNER=${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/apksigner
${ZIPALIGN} -c -v 4 ./app/build/outputs/apk/acc/release/app-acc-release-unsigned.apk
${APKSIGNER} sign \
--ks ./key.jks \
--ks-pass pass:${KEY_STORE_PASSWORD} \
--ks-key-alias ${KEY_ALIAS} \
--key-pass pass:${KEY_PASSWORD} \
--out ./app/build/outputs/apk/acc/release/app-acc-release-signed.apk \
./app/build/outputs/apk/acc/release/app-acc-release-unsigned.apk
${APKSIGNER} verify ./app/build/outputs/apk/acc/release/app-acc-release-signed.apk
env:
BUILD_TOOLS_VERSION: 29.0.3
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_BASE64: ${{ secrets.KEY_STORE_BASE64 }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- name: assets
working-directory: ./dgca-wallet-app-android
run: |-
gh release upload ${APP_VERSION} \
--clobber \
./app/build/outputs/apk/tst/release/app-tst-release-signed.apk#app-tst-release-signed-${APP_VERSION}.apk
gh release upload ${APP_VERSION} \
--clobber \
./app/build/outputs/apk/acc/release/app-acc-release-signed.apk#app-acc-release-signed-${APP_VERSION}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}