-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.49 KB
/
main.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
name: Flutter Publish Branch
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name 'David Macan'
git config user.email '[email protected]'
git config pull.rebase false # merge
- name: Mirror to main-pub branch
run: |
git fetch
git checkout -b main-pub || git checkout main-pub
git merge main
git pull origin main-pub
- name: Update .gitignore
run: |
sed -i '/\*.g.dart/d' .gitignore
sed -i '/\*.gen.dart/d' .gitignore
sed -i '/\*.freezed.dart/d' .gitignore
sed -i '/\*.gr.dart/d' .gitignore
sed -i '/\/lib\/generated/d' .gitignore
git add .gitignore
git diff --staged --exit-code || git commit -m "Update .gitignore for main-pub branch"
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.8' # Specify your Flutter version
- name: Run build_runner
run: |
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
git add .
git diff --staged --exit-code || git commit -m "Generate files with build_runner"
- name: Push changes
run: |
git push origin main-pub