-
Notifications
You must be signed in to change notification settings - Fork 274
53 lines (51 loc) · 1.78 KB
/
android-deploy.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
name: 🍏🤖 Deploy to play store
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
deployAndroid:
runs-on: ubuntu-latest
env:
GPS_JSON_KEY: ${{ secrets.GPS_JSON_KEY }}
RELEASE_KEYSTORE_FILE: ${{ secrets.RELEASE_KEYSTORE_FILE }}
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
- name: ⚙️ Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.0"
channel: 'stable'
cache: true
id: flutter
- name: Update version number from tag
run: |
# Extract the version components from refs tag (e.g., 1.2.3)
TAG_NAME=${{ github.ref_name }}
VERSION=${TAG_NAME#v} # Remove the 'v' prefix if it exists
echo "FLUTTER_BUILD_NAME=$VERSION" >> $GITHUB_ENV
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
NUMBER=$MAJOR$MINOR$PATCH
echo "FLUTTER_BUILD_NUMBER=$NUMBER" >> $GITHUB_ENV
- name: 📦 Get Packages
run: flutter pub get
- name: Setup Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Setup play store service
run: echo "$GPS_JSON_KEY" >> ./android/play-store.json
- name: Setup store key properties
run: echo "$KEYSTORE_PROPERTIES" >> ./android/key.properties
- name: Get the release keystore
run: |
echo $RELEASE_KEYSTORE_FILE | base64 --decode > android/app/whattodo_keystore.jks
- name: Build and Deploy to Play store
run: |
cd ./android
fastlane android beta