generated from ryanw-mobile/testlab-release-ci
-
-
Notifications
You must be signed in to change notification settings - Fork 13
71 lines (58 loc) · 2.29 KB
/
create_artifact_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
name: Android Build to Artifact on Tag
on:
create:
jobs:
build-and-release:
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/androidBuild/')
runs-on: ubuntu-latest
steps:
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1.2
with:
fileName: 'release.jks'
encodedString: ${{ secrets.KEYSTORE }}
- uses: actions/checkout@v4
- name: Set timezone
run: echo "TZ=Europe/London" >> $GITHUB_ENV
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Gradle build
run: ./gradlew bundleRelease assembleRelease --no-daemon
env:
CI: 'true'
KEYSTORE_LOCATION: ${{ steps.decode_keystore.outputs.filePath }}
CI_ANDROID_KEYSTORE_ALIAS: ${{ secrets.BITRISEIO_ANDROID_KEYSTORE_ALIAS }}
CI_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: ${{ secrets.BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD }}
CI_ANDROID_KEYSTORE_PASSWORD: ${{ secrets.BITRISEIO_ANDROID_KEYSTORE_PASSWORD }}
- name: Extract Version Number
run: echo "version=${GITHUB_REF#refs/tags/androidBuild/}" >> $GITHUB_ENV
- name: Upload Mapping File Artifact
uses: actions/upload-artifact@v4
with:
name: mapping-${{ env.version }}.txt
path: ./composeApp/build/outputs/mapping/release/mapping.txt
- name: Find APK file
run: |
apk_path=$(find ./composeApp/build/outputs/apk/release -name "OctoMeter-*.apk" | head -n 1)
echo "apk_path=$apk_path" >> $GITHUB_ENV
- name: Upload APK Artifact
uses: actions/upload-artifact@v4
with:
name: OctoMeter-${{ env.version }}.apk
path: ${{ env.apk_path }}
- name: Find AAB file
run: |
aab_path=$(find ./composeApp/build/outputs/bundle/release -name "OctoMeter-*.aab" | head -n 1)
echo "aab_path=$aab_path" >> $GITHUB_ENV
- name: Upload AAB Artifact
uses: actions/upload-artifact@v4
with:
name: OctoMeter-${{ env.version }}.aab
path: ${{ env.aab_path }}