-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (79 loc) · 2.68 KB
/
Copy pathandroid.yml
File metadata and controls
93 lines (79 loc) · 2.68 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
89
90
91
92
93
name: android
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "lib/**"
- "android/**"
- "pubspec.yaml"
- "pubspec.lock"
- ".github/workflows/android.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: "read"
id-token: "write"
jobs:
build:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
cache: "gradle"
java-version: 17
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.47.2
cache: true
- name: Generated code setup
run: |
flutter pub get
dart run build_runner build --delete-conflicting-outputs
- name: Setup keys
uses: timheuer/base64-to-file@v1
with:
fileName: "keystore/upload_key.jks"
encodedString: ${{ secrets.SIGNING_KEY_BASE64 }}
- name: Setup env
run: |
echo "VIDEO_SERVICE_URL=https://video.sprk.so" >> .env
echo "SPRK_APPVIEW_URL=https://api.sprk.so" >> .env
echo "MESSAGES_SERVICE_URL=https://api.sprk.chat" >> .env
echo "SHOWCASES_LICENSE_FLUTTER=${{ secrets.SHOWCASES_LICENSE_FLUTTER }}" >> .env
echo "SIGNUPS_DISABLED=false" >> .env
# Set versionCode (run number)
START_VERSION_CODE=4300
VERSION_CODE=$((START_VERSION_CODE + ${{ github.run_number }}))
sed -i "s/^\(version:.*\)+[0-9]*\$/\1+${VERSION_CODE}/" pubspec.yaml
echo "Using versionCode: $VERSION_CODE"
- name: Configure Keystore
run: |
echo "storeFile=$RUNNER_TEMP/keystore/upload_key.jks" >> key.properties
echo "storePassword=${{ secrets.SIGNING_STORE_PASSWORD }}" >> key.properties
echo "keyAlias=${{ secrets.SIGNING_KEY_ALIAS }}" >> key.properties
echo "keyPassword=${{ secrets.SIGNING_KEY_PASSWORD }}" >> key.properties
working-directory: android
- name: Build PlayStore AAB
env:
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
timeout-minutes: 30
run: |
flutter build appbundle
- name: Upload AAB to PlayStore
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: so.sprk.app
releaseFiles: build/app/outputs/bundle/release/app-release.aab
track: internal