-
-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (70 loc) · 2.38 KB
/
check.yml
File metadata and controls
80 lines (70 loc) · 2.38 KB
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
name: "Build and Check"
on:
push:
branches: [main]
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'CONTRIBUTING.md'
- 'CODE_OF_CONDUCT.md'
- 'CHANGELOG.md'
- 'UPCOMING_FEATURE_UPDATES.md'
- 'SECURITY.md'
- 'fastlane/**'
- '.github/workflows/pages-ghweb.yml'
- '.github/workflows/windows.yml'
- 'ghweb/**'
- 'assets/**'
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'CONTRIBUTING.md'
- 'CODE_OF_CONDUCT.md'
- 'CHANGELOG.md'
- 'UPCOMING_FEATURE_UPDATES.md'
- 'SECURITY.md'
- 'fastlane/**'
- '.github/workflows/pages-ghweb.yml'
- '.github/workflows/windows.yml'
- 'ghweb/**'
- 'assets/**'
jobs:
build:
name: Build and Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.7'
channel: 'stable'
- name: Get Flutter Dependencies
run: flutter pub get
- name: Extract version from pubspec.yaml
run: |
VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}' | cut -d+ -f1)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build APK (github flavor)
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.vfs.watch=false
run: flutter build apk --release --flavor github --build-number ${{ github.run_number }}
- name: Rename APK
run: |
APK_PATH=$(find build/app/outputs/flutter-apk -maxdepth 1 -type f -name "app*github*release.apk" ! -name "*armeabi-v7a*" ! -name "*arm64-v8a*" | head -n 1)
test -n "$APK_PATH" || (echo "GitHub flavor release APK not found" && ls -la build/app/outputs/flutter-apk && exit 1)
mv "$APK_PATH" build/app/outputs/flutter-apk/Hongeet_v${VERSION}+${{ github.run_number }}.apk
- name: Upload APK as artifact
uses: actions/upload-artifact@v4
with:
name: Hongeet Release
path: build/app/outputs/flutter-apk/Hongeet_v${{env.VERSION}}+${{github.run_number}}.apk