-
Notifications
You must be signed in to change notification settings - Fork 38
118 lines (103 loc) · 3.8 KB
/
smoke.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# This workflow builds the iOS and Android apps, just to check they build without error
name: Smoke build
on:
push:
branches:
- main
pull_request:
jobs:
build-android:
name: Android
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: nebula/go.sum
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.1'
- name: install dependencies
env:
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
flutter pub get
touch env.sh
- name: Build Android debug
run: flutter build appbundle --debug
- name: Setup bundletool
if: github.ref == 'refs/heads/main'
uses: amyu/setup-bundletool@f7a6fdd8e04bb23d2fdf3c2f60c9257a6298a40a
- name: Install the google play key material
if: github.ref == 'refs/heads/main'
env:
GOOGLE_PLAY_API_JWT_BASE64: ${{ secrets.GOOGLE_PLAY_API_JWT_BASE64 }}
GOOGLE_PLAY_KEYSTORE_BASE64: ${{ secrets.GOOGLE_PLAY_KEYSTORE_BASE64 }}
run: |
GOOGLE_PLAY_API_JWT_PATH="$RUNNER_TEMP/gp_api.json"
echo "GOOGLE_PLAY_API_JWT_PATH=$GOOGLE_PLAY_API_JWT_PATH" >> $GITHUB_ENV
echo -n "$GOOGLE_PLAY_API_JWT_BASE64" | base64 --decode --output "$GOOGLE_PLAY_API_JWT_PATH"
GOOGLE_PLAY_KEYSTORE_PATH="$RUNNER_TEMP/gp_signing.jks"
echo "GOOGLE_PLAY_KEYSTORE_PATH=$GOOGLE_PLAY_KEYSTORE_PATH" >> $GITHUB_ENV
echo -n "$GOOGLE_PLAY_KEYSTORE_BASE64" | base64 --decode --output "$GOOGLE_PLAY_KEYSTORE_PATH"
- name: Generate debug apk
if: github.ref == 'refs/heads/main'
env:
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
GOOGLE_PLAY_KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_PLAY_KEYSTORE_PASSWORD }}
run: |
bundletool build-apks \
--bundle=build/app/outputs/bundle/debug/app-debug.aab \
--output=build/app/outputs/apk/debug/app-debug.apks \
--mode=universal \
--ks=$GOOGLE_PLAY_KEYSTORE_PATH \
--ks-key-alias=key \
--ks-pass=pass:$GOOGLE_PLAY_KEYSTORE_PASSWORD
unzip -p build/app/outputs/apk/debug/app-debug.apks universal.apk > build/app/outputs/apk/debug/app-debug.apk
- name: Collect debug apk
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: MobileNebulaDebug.apk
path: build/app/outputs/apk/debug/app-debug.apk
retention-days: 60
build-ios:
name: iOS
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: nebula/go.sum
- name: Install flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.1'
- name: install dependencies
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
flutter pub get
touch env.sh
- name: Build iOS
run: |
cd ios
pod install
xcodebuild -workspace Runner.xcworkspace -scheme Runner -configuration Release clean archive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -archivePath "build/MobileNebula.xcarchive"