-
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (125 loc) · 4.37 KB
/
deploy-android.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: PUSH on develop (Test Flutter & Build Android & Deploy Android internal)
on:
push:
branches:
- develop
paths-ignore:
- ".github/**"
- ".vscode/**"
- "releases/**"
- "test/**"
- "ios/**"
- "web/**"
- "**/README.md"
- "**/GitVersion.yml"
workflow_dispatch: null
jobs:
test:
name: flutter test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ vars.JAVA_VERSION }}
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ vars.DART_VERSION }}
- run: dart --version
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- run: flutter --version
- run: flutter pub get
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
- run: flutter analyze
- run: flutter test
build:
name: Build Android
needs: [test]
runs-on: ubuntu-latest
outputs:
releaseversion: ${{ steps.version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lesen der aktuellen Version aus der pubspec.yaml
id: get_version
run: |
VERSION=$(grep "version:" pubspec.yaml | awk '{print $2}')
echo "currentVersion=$VERSION" >> $GITHUB_OUTPUT
echo "Die aaktuelle Version ist $VERSION"
- name: Set new version of app
id: version
run: |
VERSION=${{steps.get_version.outputs.currentVersion}}
VERSION_WITHOUT_PLUS="${VERSION%%+*}"
GITHUB_RUN_NUMBER=${{ github.run_number }}
sed -i "/version:/c version: $VERSION_WITHOUT_PLUS+$GITHUB_RUN_NUMBER" pubspec.yaml
echo "Die neue Version ist $VERSION_WITHOUT_PLUS+$GITHUB_RUN_NUMBER"
echo "version=$VERSION_WITHOUT_PLUS+$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
- name: Write version to Summary
run: |
echo "### Version: ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_WIREDASH_SECRET: ${{ secrets.PROD_WIREDASH_SECRET }} # ignore error
envkey_WIREDASH_PROJECT_ID: ${{ secrets.PROD_WIREDASH_PROJECT_ID }} # ignore error
envkey_GEOAPIFY_KEY: ${{ secrets.GEOAPIFY_KEY }} # ignore error
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ vars.JAVA_VERSION }}
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ vars.DART_VERSION }}
- run: dart --version
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- run: dart --version
- run: flutter pub get
- name: Build aab
run: flutter build appbundle --obfuscate --split-debug-info=build/app/outputs/symbols
id:
build_aab
# Build Android App Bundle which by default will be stored in the
# ./build/app/outputs/bundle/release as app-release.aab
- name: Sign App Bundle
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
releaseDirectory: build/app/outputs/bundle/release/
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }}
alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
- name: Upload Signed App Bundle
uses: actions/upload-artifact@v3
with:
name: signed-app-bundle
path: build/app/outputs/bundle/release/app-release.aab
deploy:
name: Deploy Android
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
id: download-signed-app
with:
name: signed-app-bundle
- name: Upload to Play Store (Internal Testing)
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }}
packageName: de.jlange.nami.app
releaseFiles: app-release.aab
releaseName: ${{ needs.build.outputs.releaseversion }}
track: internal