-
Notifications
You must be signed in to change notification settings - Fork 20
146 lines (126 loc) · 3.97 KB
/
build.yaml
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
on:
workflow_dispatch:
schedule:
- cron: "0 11 * * *"
name: Build
env:
FLUTTER_VERSION: 3.22.1
XCODE_VERSION: ^15.0.1
jobs:
build_debug_mobile:
name: Build debug version for mobiles
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: android
runner: ubuntu-latest
- os: ios
runner: macos-latest
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}"
- name: Setup Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
bundler-cache: true
working-directory: ${{ matrix.os }}
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Java
if: matrix.os == 'android'
uses: actions/setup-java@v4
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: "17"
- name: Select Xcode version
if: matrix.os == 'ios'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Setup iOS
if: matrix.os == 'ios'
run: ./scripts/prepare-ios.sh
- name: Build debug APK
if: matrix.os == 'android'
run: |
./scripts/build-android-debug.sh
cp build/app/outputs/apk/debug/app-debug.apk twake-on-matrix-debug.apk
- name: Build debug IPA
if: matrix.os == 'ios'
env:
APPLE_CERTIFICATES_SSH_KEY: ${{ secrets.APPLE_CERTIFICATES_SSH_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: |
bundle exec fastlane dev
cp Runner.ipa ../Runner.ipa
working-directory: ${{ matrix.os }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: twake-on-matrix-dev-${{ matrix.os }}
path: |
twake-on-matrix-debug.apk
Runner.ipa
build_debug_desktop:
name: Build debug version for desktops
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: macos
runner: macos-latest
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}"
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup
run: |
ssh-keyscan github.com >> ~/.ssh/known_hosts
flutter pub global activate flutter_distributor
shell: bash
- name: Setup Fastlane (macOS only)
uses: ruby/setup-ruby@v1
if: matrix.os == 'macos'
with:
ruby-version: ruby
bundler-cache: true
working-directory: ${{ matrix.os }}
- name: Build
env:
APPLE_CERTIFICATES_SSH_KEY: ${{ secrets.APPLE_CERTIFICATES_SSH_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: ./scripts/build-${{ matrix.os }}-debug.sh
shell: bash
- name: Package
run: ./scripts/package-${{ matrix.os }}-debug.sh
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: twake-on-matrix-dev-${{ matrix.os }}
path: dist/