-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (126 loc) · 4.92 KB
/
Copy pathbuild.yml
File metadata and controls
154 lines (126 loc) · 4.92 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Build Flutter App
on:
push:
branches: [ main, develop ]
tags:
- 'v*'
pull_request:
branches: [ main, develop ]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-android:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.0'
channel: 'stable'
cache: true
- name: Get Flutter version
run: flutter --version
- name: Create debug keystore for CI
run: |
mkdir -p $HOME/.android
keytool -genkey -v -keystore $HOME/.android/debug.keystore \
-storepass android -alias androiddebugkey -keypass android \
-keyalg RSA -keysize 2048 -validity 10000 \
-dname "CN=Android Debug,O=Android,C=US"
- name: Install dependencies
run: flutter pub get
- name: Run code generation
run: |
flutter pub run build_runner build --delete-conflicting-outputs || \
flutter pub run build_runner build --delete-conflicting-outputs --verbose
- name: Analyze code
run: flutter analyze --no-fatal-infos
continue-on-error: true
- name: Run tests
run: flutter test
continue-on-error: true
- name: Extract version from pubspec.yaml
id: version
run: |
VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r')
BUILD_NUMBER=${{ github.run_number }}
FULL_VERSION="${VERSION}-build.${BUILD_NUMBER}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "full_version=$FULL_VERSION" >> $GITHUB_OUTPUT
echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT
echo "Version: $FULL_VERSION"
- name: Build APK
run: flutter build apk --release --build-name=${{ steps.version.outputs.version }} --build-number=${{ steps.version.outputs.build_number }}
- name: Build App Bundle
run: flutter build appbundle --release --build-name=${{ steps.version.outputs.version }} --build-number=${{ steps.version.outputs.build_number }}
- name: Rename and prepare artifacts
run: |
mkdir -p artifacts
cp build/app/outputs/flutter-apk/app-release.apk artifacts/claude-code-mobile-${{ steps.version.outputs.full_version }}.apk
cp build/app/outputs/bundle/release/app-release.aab artifacts/claude-code-mobile-${{ steps.version.outputs.full_version }}.aab
# Create checksums
cd artifacts
sha256sum *.apk > checksums.txt
sha256sum *.aab >> checksums.txt
cd ..
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: android-apk-${{ steps.version.outputs.full_version }}
path: artifacts/*.apk
retention-days: 30
- name: Upload App Bundle artifact
uses: actions/upload-artifact@v4
with:
name: android-aab-${{ steps.version.outputs.full_version }}
path: artifacts/*.aab
retention-days: 30
- name: Upload checksums
uses: actions/upload-artifact@v4
with:
name: checksums-${{ steps.version.outputs.full_version }}
path: artifacts/checksums.txt
retention-days: 30
- name: Create Auto Release
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.full_version }}
name: Release v${{ steps.version.outputs.full_version }}
files: |
artifacts/claude-code-mobile-${{ steps.version.outputs.full_version }}.apk
artifacts/claude-code-mobile-${{ steps.version.outputs.full_version }}.aab
artifacts/checksums.txt
body: |
## Claude Code Mobile v${{ steps.version.outputs.full_version }}
**Build #${{ steps.version.outputs.build_number }}** - Auto-generated release
### Downloads
- **APK**: `claude-code-mobile-${{ steps.version.outputs.full_version }}.apk` - For direct installation
- **AAB**: `claude-code-mobile-${{ steps.version.outputs.full_version }}.aab` - For Google Play Store
### Installation
1. Download the APK file
2. Enable "Install from Unknown Sources" on your Android device
3. Install the APK
### Checksums
See `checksums.txt` for SHA256 checksums of all files.
### Changes
${{ github.event.head_commit.message }}
---
Built with Flutter 3.19.0 on ${{ github.run_id }}
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}