forked from localsend/localsend
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (82 loc) · 2.58 KB
/
ci.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
FLUTTER_VERSION: "3.24.5"
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Dependencies (app)
working-directory: app
run: flutter pub get
- name: Remove gen directory (app)
working-directory: app
run: rm -rf lib/gen
- name: Check format (app)
working-directory: app
run: dart format --line-length 150 --set-exit-if-changed lib test
- name: Dependencies (common)
working-directory: common
run: dart pub get
- name: Check format (common)
working-directory: common
run: dart format --line-length 150 --set-exit-if-changed lib test
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Dependencies (app)
working-directory: app
run: flutter pub get
- name: Analyze (app)
working-directory: app
run: flutter analyze
- name: Test (app)
working-directory: app
run: flutter test
- name: Dependencies (common)
working-directory: common
run: dart pub get
- name: Analyze (common)
working-directory: common
run: dart analyze
- name: Test (common)
working-directory: common
run: dart test
packaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract version from pubspec.yaml
id: pubspec_version
run: |
VERSION=$(grep '^version: ' app/pubspec.yaml | sed 's/version: //' | sed 's/\+.*//')
echo "Pubspec version is $VERSION"
echo "pubspec_version=$VERSION" >> $GITHUB_ENV
- name: Extract version from Inno Setup configuration
id: inno_version
run: |
VERSION=$(grep '#define MyAppVersion ' scripts/compile_windows_exe-inno.iss | sed 's/#define MyAppVersion "//' | sed 's/"//')
echo "Inno Setup version is $VERSION"
echo "inno_version=$VERSION" >> $GITHUB_ENV
- name: Compare pubspec and Inno Setup versions
run: |
if [ "$pubspec_version" != "$inno_version" ]; then
echo "Version mismatch detected!"
exit 1
else
echo "Versions match."
fi