-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (67 loc) · 2.7 KB
/
cd_playstore.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
name: Boletify CD - Publish Android
on:
push:
branches:
- release
jobs:
publish-android:
runs-on: ubuntu-latest
steps:
- name: Checkout the branch
uses: actions/checkout@v2
- name: Read last version tag
run: |
git fetch --prune --unshallow
echo "VERSION=$(git describe --tag `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
- name: Set current build version
run: |
echo "BUILD_VERSION=$(echo $VERSION | cut -d'v' -f 2 | cut -d'+' -f 1)" >> $GITHUB_ENV
- name: Set current major and minor version
run: |
echo "BUILD_VERSION_MAJOR_MINOR=$(echo $BUILD_VERSION | cut -d'.' -f 1,2)" >> $GITHUB_ENV
- name: Set current patch version
run: |
echo "BUILD_VERSION_PATCH=$(echo $BUILD_VERSION | cut -d'.' -f 3)" >> $GITHUB_ENV
- name: Set next patch version
run: |
echo "NEXT_BUILD_VERSION_PATCH=$(echo $(($BUILD_VERSION_PATCH+1)))" >> $GITHUB_ENV
- name: Set next build version
run: |
echo "NEXT_BUILD_VERSION=$(echo $BUILD_VERSION_MAJOR_MINOR.$NEXT_BUILD_VERSION_PATCH)" >> $GITHUB_ENV
- name: Set current build number
run: |
echo "BUILD_NUMBER=$(echo $VERSION | cut -d'v' -f 2 | cut -d'+' -f 2 | cut -d\' -f 1)" >> $GITHUB_ENV
- name: Set next build number
run: |
echo "NEXT_BUILD_NUMBER=$(echo $(($BUILD_NUMBER+1)))" >> $GITHUB_ENV
- name: Print next build version tag
run: |
echo v$NEXT_BUILD_VERSION+$NEXT_BUILD_NUMBER
- name: Install flutter
uses: subosito/flutter-action@v1
- name: Get packages
run: flutter pub get
- name: Generate keystore
run: echo $KEY_JKS | base64 -d > android/app/key.jks
env:
KEY_JKS: ${{ secrets.KEYSTORE_JKS_B64 }}
- name: Release compilation
run: flutter build appbundle --release --build-name $NEXT_BUILD_VERSION --build-number $NEXT_BUILD_NUMBER
env:
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PATH: key.jks
- name: Publish Google Play (Closed Alpha)
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.ebgapps.boletify
track: alpha
releaseFile: build/app/outputs/bundle/release/app-release.aab
- name: Create new git version tag
run: |
echo "NEXT_GIT_TAG=$(echo v$NEXT_BUILD_VERSION+$NEXT_BUILD_NUMBER)" >> $GITHUB_ENV
- name: Update and push tag
run: |
git tag $NEXT_GIT_TAG
git push origin $NEXT_GIT_TAG