-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (109 loc) · 3.97 KB
/
main.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
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
name: my_pesa
on:
push:
tags:
- "v*"
branches:
- main
pull_request:
branches:
- main
jobs:
test:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: stable
# Creates Issues from comments
create_issues:
runs-on: "ubuntu-latest"
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v2
- name: TODO to Issue
uses: alstr/[email protected]
publish-android:
# Only Run on tags
if: startsWith(github.ref, 'refs/tags/')
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "17"
- uses: subosito/flutter-action@v2
with:
channel: "stable" # or: 'beta' or 'master'
cache: true
cache-key: flutter-android # optional, change this to force refresh cache
cache-path: ${{ runner.tool_cache }}/flutter-android # optional, change this to specify the cache path
- run: flutter pub get
- run: flutter test
# Setup Keystore ANDROID_KEYSTORE=(openssl base64 -A -in my.keystore > base64)
- name: Setup Keystore
shell: bash
env:
ANDROID_KEYSTORE: ${{secrets.ANDROID_KEYSTORE}}
KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}}
ALIAS_NAME: ${{secrets.ALIAS_NAME}}
KEY_PASSWORD: ${{secrets.KEY_PASSWORD}}
run: |
sh ./.github/workflows/scripts/setup_keystore.sh
# Build
- name: Build APK
run: flutter build apk --flavor production -t ./lib/main_production.dart
- name: Build AppBundle
run: flutter build appbundle --flavor production -t ./lib/main_production.dart
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: |
build/app/outputs/bundle/productionRelease/app-production-release.aab
build/app/outputs/flutter-apk/app-production-release.apk
publish-macos:
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
architecture: x64
channel: "stable" # or: 'beta' or 'master'
cache: true
cache-key: flutter-mac # optional, change this to force refresh cache
cache-path: ${{ runner.tool_cache }}/flutter-mac # optional, change this to specify the cache path
- run: flutter config --enable-macos-desktop
- name: Build MacOS
run: flutter build macos -t ./lib/main_production.dart
- name: Move
run: |
mkdir ./build/macos/Build/Products/Release/dist/
mv ./build/macos/Build/Products/Release/my_pesa.app/ ./build/macos/Build/Products/Release/dist
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: myPesa-${{github.ref_name}}-macos.zip
directory: build/macos/Build/Products/Release/dist
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: |
build/macos/Build/Products/Release/myPesa-${{github.ref_name}}-macos.zip
publish-linux:
if: ${{ false }} # startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable" # or: 'beta' or 'master'
cache: true
cache-key: flutter-linux # optional, change this to force refresh cache
cache-path: ${{ runner.tool_cache }}/flutter-linux # optional, change this to specify the cache path
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- run: flutter config --enable-linux-desktop
- name: Build Linux
run: flutter build linux --flavor production -t ./lib/main_production.dart