-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (81 loc) · 2.89 KB
/
releases.yaml
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
on:
push:
tags: ['*']
name: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/[email protected]
-
name: Configure Java
uses: actions/[email protected]
with:
java-version: 17
distribution: oracle
-
name: Keystore Setup
run: echo "${{secrets.ANDROID_KEYSTORE_64}}" | base64 --decode > sleeps.keystore
-
name: Test
run: ./gradlew --no-daemon check
-
env:
ORG_GRADLE_PROJECT_signingFile: sleeps.keystore
ORG_GRADLE_PROJECT_signingKeyPassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ORG_GRADLE_PROJECT_signingStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ORG_GRADLE_PROJECT_signingAlias: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
name: Build Android App
run: ./gradlew --no-daemon assembleRelease bundleRelease -Pcommit=${{ github.sha }} -PversionName=${{ github.ref_name }} -PversionCode=$((($GITHUB_RUN_NUMBER * 10) + $GITHUB_RUN_ATTEMPT))
-
name: Prepare Uploads
run: |
mkdir -p build
mkdir -p build/output
cp android/build/outputs/apk/release/android-release.apk build/output/Sleeps-${{ github.ref_name }}.apk
cp android/build/outputs/bundle/release/android-release.aab build/output/Sleeps-${{ github.ref_name }}.aab
-
name: Archive APK
uses: actions/[email protected]
with:
name: Android APK
path: build/output/Sleeps-${{ github.ref_name }}.apk
-
name: Archive Bundle
uses: actions/[email protected]
with:
name: Android AAB
path: build/output/Sleeps-${{ github.ref_name }}.aab
-
name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: true
-
name: Upload AAB Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/output/Sleeps-${{ github.ref_name }}.aab
asset_name: Sleeps-${{ github.ref_name }}.aab
asset_content_type: application/octet-stream
-
name: Upload APK Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/output/Sleeps-${{ github.ref_name }}.apk
asset_name: Sleeps-${{ github.ref_name }}.apk
asset_content_type: application/octet-stream